From 4a279ff09e124542cdbee1cb4c051b7f0125e13a Mon Sep 17 00:00:00 2001 From: ldjebran Date: Wed, 27 Feb 2019 15:25:41 +0200 Subject: [PATCH] Some basic fixes for 3.6 better support - 2 --- .travis.yml | 3 ++- requirements.txt | 3 --- robozilla/decorators/__init__.py | 2 +- robozilla/parser.py | 2 +- robozilla/scan.py | 8 ++++---- setup.py | 4 ++-- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0eaa60d..3a070e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,8 @@ python: install: - pip install -U pip - pip install -r requirements.txt - - pip install 'pytest>=4.0.2' pytest-cov pytest-xdist flake8 codecov unittest2 + - pip install 'pytest>=4.0.2' + - pip install pytest-cov pytest-xdist flake8 codecov unittest2 script: - make lint - make test diff --git a/requirements.txt b/requirements.txt index 7f3334b..d829da4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,2 @@ -Click>=6.0 -python-bugzilla>=1.2.2 -six>=1.10.0 --editable . diff --git a/robozilla/decorators/__init__.py b/robozilla/decorators/__init__.py index 529786e..b56f1d0 100644 --- a/robozilla/decorators/__init__.py +++ b/robozilla/decorators/__init__.py @@ -193,7 +193,7 @@ def _skip_downstream_condition(bug, sat_version_picker=None): target_milestone_version = bug['target_milestone'] has_down_and_zstream = downstream_versions and zstream_versions - if has_down_and_zstream and target_milestone_version is 'Unspecified': + if has_down_and_zstream and target_milestone_version == 'Unspecified': LOGGER.warning('Bugzilla with both downstream and zstream flags and ' 'unspecified target_milestone: {}'.format(bug)) return True diff --git a/robozilla/parser.py b/robozilla/parser.py index 757efaf..2690dec 100644 --- a/robozilla/parser.py +++ b/robozilla/parser.py @@ -21,7 +21,7 @@ def __init__(self, files_provider, filters=None, reporter=None, warn=True, bz_reader=None, environment=None, reader_options=None): if isinstance(files_provider, six.string_types): - files_provider = FilesProvider(files_provider) + files_provider = FilesProvider(files_provider) self.files_provider = files_provider self.filters = filters if filters is not None else [ diff --git a/robozilla/scan.py b/robozilla/scan.py index 397ec50..d1e2e27 100644 --- a/robozilla/scan.py +++ b/robozilla/scan.py @@ -86,10 +86,10 @@ def scan(scan_dir, filters, warn, all, duplicates, clones, depends, echo, user, reader_options['follow_depends'] = True if not user and BUGZILLA_ENVIRON_USER_NAME in os.environ: - user = os.environ[BUGZILLA_ENVIRON_USER_NAME] + user = os.environ[BUGZILLA_ENVIRON_USER_NAME] if not password and BUGZILLA_ENVIRON_USER_PASSWORD_NAME in os.environ: - password = os.environ[BUGZILLA_ENVIRON_USER_PASSWORD_NAME] + password = os.environ[BUGZILLA_ENVIRON_USER_PASSWORD_NAME] if (user and not password) or (not user and password): raise Exception('you must provide a user and password') @@ -137,10 +137,10 @@ def coverage(exclude_components, include_flags, exclude_flags, start_date, reader_options = {} if not user and BUGZILLA_ENVIRON_USER_NAME in os.environ: - user = os.environ[BUGZILLA_ENVIRON_USER_NAME] + user = os.environ[BUGZILLA_ENVIRON_USER_NAME] if not password and BUGZILLA_ENVIRON_USER_PASSWORD_NAME in os.environ: - password = os.environ[BUGZILLA_ENVIRON_USER_PASSWORD_NAME] + password = os.environ[BUGZILLA_ENVIRON_USER_PASSWORD_NAME] if (user and not password) or (not user and password): raise Exception('you must provide a user and password') if user and password: diff --git a/setup.py b/setup.py index 8a4abc6..686de30 100755 --- a/setup.py +++ b/setup.py @@ -18,8 +18,8 @@ requirements = [ 'Click>=6.0', - 'python_bugzilla', - 'six' + 'python-bugzilla>=1.2.2', + 'six>=1.10.0', ] test_requirements = []