Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Merged in feature/remove-future-mock (pull request #51)
Browse files Browse the repository at this point in the history
Cleanup __future__ and mock
  • Loading branch information
Lusheng Lv committed Apr 20, 2017
2 parents 9dbe172 + a8f69ae commit caec221
Show file tree
Hide file tree
Showing 54 changed files with 11 additions and 108 deletions.
1 change: 0 additions & 1 deletion badwolf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

__version__ = u'0.8.3'

Expand Down
1 change: 0 additions & 1 deletion badwolf/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import logging.config

Expand Down
2 changes: 0 additions & 2 deletions badwolf/bitbucket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging
from urllib.parse import quote

Expand Down
2 changes: 0 additions & 2 deletions badwolf/builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import io
import time
Expand Down
1 change: 0 additions & 1 deletion badwolf/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import signal

import click
Expand Down
7 changes: 4 additions & 3 deletions badwolf/cloner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import logging

Expand Down Expand Up @@ -42,13 +41,15 @@ def clone(self):
# Push to branch or ci retry comment on some commit
if not self.is_commit_exists(gitcmd, self.commit_hash):
logger.info('Unshallowing a shallow cloned repository')
gitcmd.fetch('--unshallow')
output = gitcmd.fetch('--unshallow')
logger.info('%s', output)
logger.info('Checkout commit %s', self.commit_hash)
gitcmd.checkout(self.commit_hash)

gitmodules = os.path.join(clone_path, '.gitmodules')
if os.path.exists(gitmodules):
gitcmd.submodule('update', '--init', '--recursive')
output = gitcmd.submodule('update', '--init', '--recursive')
logger.info('%s', output)

def _merge_pull_request(self, gitcmd):
# Pull Request
Expand Down
2 changes: 0 additions & 2 deletions badwolf/context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import uuid

Expand Down
2 changes: 0 additions & 2 deletions badwolf/default_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os
import sys
import base64
Expand Down
2 changes: 0 additions & 2 deletions badwolf/deploy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import time
import logging

Expand Down
1 change: 0 additions & 1 deletion badwolf/deploy/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals


class Provider(object):
Expand Down
2 changes: 0 additions & 2 deletions badwolf/deploy/providers/pypi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging

from badwolf.utils import run_command
Expand Down
1 change: 0 additions & 1 deletion badwolf/deploy/providers/script.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from badwolf.utils import run_command
from badwolf.deploy.providers import Provider
Expand Down
1 change: 0 additions & 1 deletion badwolf/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals


class BadwolfException(Exception):
Expand Down
1 change: 0 additions & 1 deletion badwolf/extensions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from raven.contrib.flask import Sentry
from flask_mail import Mail

Expand Down
1 change: 0 additions & 1 deletion badwolf/lint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals


class Problem(object):
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import re
import sys
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/bandit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import io
import csv
Expand Down
1 change: 0 additions & 1 deletion badwolf/lint/linters/csslint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os

from badwolf.utils import run_command
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/eslint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os

from badwolf.utils import run_command
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/flake8.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import logging
import configparser
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/jscs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os

from badwolf.utils import run_command
Expand Down
1 change: 0 additions & 1 deletion badwolf/lint/linters/jsonlint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import re

Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/pep8.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging

from badwolf.utils import run_command
Expand Down
1 change: 0 additions & 1 deletion badwolf/lint/linters/pylint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging

from badwolf.utils import to_text, run_command
Expand Down
1 change: 0 additions & 1 deletion badwolf/lint/linters/rstlint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import logging

Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/sasslint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os

from badwolf.utils import run_command
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/shellcheck.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from badwolf.utils import run_command
from badwolf.lint import Problem
from badwolf.lint.linters import Linter
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/stylelint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import json

Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/linters/yamllint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging

from badwolf.utils import run_command
Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import time
import logging

Expand Down
2 changes: 0 additions & 2 deletions badwolf/lint/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
from xml.etree import ElementTree

Expand Down
2 changes: 0 additions & 2 deletions badwolf/log/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import logging

Expand Down
2 changes: 0 additions & 2 deletions badwolf/notification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import logging
import smtplib

Expand Down
1 change: 0 additions & 1 deletion badwolf/oauth/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging

from flask import Blueprint, request, current_app, redirect, jsonify
Expand Down
2 changes: 0 additions & 2 deletions badwolf/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import shutil
import logging
Expand Down
1 change: 0 additions & 1 deletion badwolf/security.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from flask import current_app, Blueprint, request
from cryptography.fernet import Fernet
Expand Down
2 changes: 0 additions & 2 deletions badwolf/spec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import io
import base64
import logging
Expand Down
2 changes: 0 additions & 2 deletions badwolf/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import time
import logging
from concurrent.futures import ProcessPoolExecutor
Expand Down
2 changes: 0 additions & 2 deletions badwolf/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import logging
import subprocess
Expand Down
2 changes: 0 additions & 2 deletions badwolf/webhook/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import json
import logging

Expand Down
1 change: 0 additions & 1 deletion badwolf/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from badwolf import create_app


Expand Down
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pytest
pytest-cov
pytest-capturelog
coverage
mock
Sphinx
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import sys

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest


Expand Down
6 changes: 1 addition & 5 deletions tests/test_auto_merge_pull_request.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

from flask import url_for

Expand Down
6 changes: 1 addition & 5 deletions tests/test_bitbucket_webhook_comment.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

from flask import url_for

Expand Down
6 changes: 1 addition & 5 deletions tests/test_bitbucket_webhook_pr_created_updated.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

from flask import url_for

Expand Down
7 changes: 1 addition & 6 deletions tests/test_bitbucket_webhook_repo_push.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import json
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

from flask import url_for

Expand Down
7 changes: 1 addition & 6 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

from unidiff import PatchSet

Expand Down
1 change: 0 additions & 1 deletion tests/test_log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for


Expand Down
6 changes: 1 addition & 5 deletions tests/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
try:
import unittest.mock as mock
except ImportError:
import mock
import unittest.mock as mock

import git
import pytest
Expand Down
1 change: 0 additions & 1 deletion tests/test_secure_token.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from badwolf.security import SecureToken

Expand Down

0 comments on commit caec221

Please sign in to comment.