From 022460d115adc0d4aeb02bde6d9c30ecd885c86a Mon Sep 17 00:00:00 2001 From: aarif Date: Thu, 7 Nov 2019 15:25:56 +0500 Subject: [PATCH] Updated the config to upgrade/support django2.2 updated the packages with make upgrade changes made to resolve failures fix quality failures suppressed the health check fix quality failures Fixed failing tests further changes added healthcheck to failing tests updated the requirements according to compatibility with both python version and fixed some quality issues changes made to fix quality errors removed redundant parenthesis further quality fixes made changes as suggested minor changes changes made as suggested reverted the imports order to original changes made to suppress pylint warnings updated the tox config changes made as suggested updated the travis config to run non django tests on travis pipeline --- .travis.yml | 30 +++++- Makefile | 3 - opaque_keys/__init__.py | 5 +- opaque_keys/edx/django/models.py | 10 +- opaque_keys/edx/django/tests/test_models.py | 2 - opaque_keys/edx/keys.py | 5 +- opaque_keys/edx/locator.py | 6 +- opaque_keys/edx/tests/test_aside_keys.py | 4 + opaque_keys/edx/tests/test_properties.py | 4 +- requirements/base.txt | 8 +- requirements/dev.txt | 105 ++++++++++---------- requirements/django.txt | 59 ++++++----- requirements/doc.txt | 88 ++++++++-------- requirements/pip-tools.txt | 4 +- requirements/test.txt | 59 ++++++----- requirements/travis.txt | 36 ++++--- setup.py | 3 +- tox.ini | 27 ++++- 18 files changed, 267 insertions(+), 191 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d90005f..7c4e81a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,35 @@ language: python python: - "2.7" - - "3.6" + - "3.5" + +env: + - TOXENV=django111 + - TOXENV=django20 + - TOXENV=django21 + - TOXENV=django22 + +matrix: + exclude: + - python: "2.7" + env: TOXENV=django20 + - python: "2.7" + env: TOXENV=django21 + - python: "2.7" + env: TOXENV=django22 + include: + - python: "3.5" + env: TOXENV=quality + - python: "2.7" + env: TOXENV=pytest-py27 + - python: "3.5" + env: TOXENV=pytest-py35 + install: - make requirements - pip install coveralls script: - tox -- --hypothesis-profile=ci - - make quality after_success: - coveralls deploy: @@ -17,5 +39,7 @@ deploy: secure: cnCf0zDyTEJycCDcxhH1GsvOWNGImjwc8WIrD/D5Hsk7p0IeMaEjc/t6gc1LO2iQKGlZq/BLDxUBmsEbrQUD1wvSBg/J+9Ji6yn9jJ87X6QSNq+Xy0brLe9RAeMElG3OLqbj6FHRMzk2EmOEJXI9ATqlXfdqFwgKCYrvf2GT2Ug= on: tags: true + python: "3.5" + condition: "$TOXENV = django111" distributions: sdist bdist_wheel - repo: edx/opaque-keys + repo: edx/opaque-keys \ No newline at end of file diff --git a/Makefile b/Makefile index f0647a2a..8d664a10 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,6 @@ clean: ## remove generated byte code, coverage reports, and build artifacts html_coverage: coverage html && open htmlcov/index.html -quality: - pycodestyle --config=.pep8 opaque_keys - pylint --rcfile=pylintrc opaque_keys requirements: pip install -r requirements/dev.txt diff --git a/opaque_keys/__init__.py b/opaque_keys/__init__.py index 9db687cd..00d3369b 100644 --- a/opaque_keys/__init__.py +++ b/opaque_keys/__init__.py @@ -8,8 +8,6 @@ """ from abc import ABCMeta, abstractmethod from functools import total_ordering - -from _collections import defaultdict from six import ( iteritems, python_2_unicode_compatible, @@ -20,6 +18,9 @@ ) from stevedore.enabled import EnabledExtensionManager +# pylint: disable=wrong-import-order +from _collections import defaultdict + class InvalidKeyError(Exception): """ diff --git a/opaque_keys/edx/django/models.py b/opaque_keys/edx/django/models.py index 1d3880ce..c69747a2 100644 --- a/opaque_keys/edx/django/models.py +++ b/opaque_keys/edx/django/models.py @@ -121,8 +121,7 @@ def to_python(self, value): )) value = value.rstrip() return self.KEY_CLASS.from_string(value) - else: - return value + return value def get_prep_value(self, value): if value is self.Empty or value is None: @@ -147,15 +146,14 @@ def get_prep_value(self, value): def validate(self, value, model_instance): """Validate Empty values, otherwise defer to the parent""" # raise validation error if the use of this field says it can't be blank but it is - if not self.blank and value is self.Empty: - raise ValidationError(self.error_messages['blank']) - else: + if self.blank or value is not self.Empty: return super(OpaqueKeyField, self).validate(value, model_instance) + raise ValidationError(self.error_messages['blank']) def run_validators(self, value): """Validate Empty values, otherwise defer to the parent""" if value is self.Empty: - return + return None return super(OpaqueKeyField, self).run_validators(value) diff --git a/opaque_keys/edx/django/tests/test_models.py b/opaque_keys/edx/django/tests/test_models.py index d1eff602..7eb0f35f 100644 --- a/opaque_keys/edx/django/tests/test_models.py +++ b/opaque_keys/edx/django/tests/test_models.py @@ -22,7 +22,6 @@ @pytest.fixture(autouse=True) def enable_db_access_for_all_tests(db): """Enable DB access for all tests.""" - pass # pylint: disable=no-member @@ -44,7 +43,6 @@ def test_load_model_from_db(self): class EmptyKeyClassField(OpaqueKeyField): """An invalid class.""" - pass # pylint: disable=protected-access diff --git a/opaque_keys/edx/keys.py b/opaque_keys/edx/keys.py index e22c6282..fe4b2c2b 100644 --- a/opaque_keys/edx/keys.py +++ b/opaque_keys/edx/keys.py @@ -242,10 +242,10 @@ def map_into_course(self, course_key): Implement map_into_course for API compatibility. Shouldn't be used in new code. """ + if course_key == self.context_key: return self - else: - raise ValueError("Cannot use map_into_course like that with this key type.") + raise ValueError("Cannot use map_into_course like that with this key type.") class AsideDefinitionKey(DefinitionKey): @@ -300,6 +300,7 @@ def default(self, key): # pylint: disable=arguments-differ, method-hidden if isinstance(key, OpaqueKey): return text_type(key) super(i4xEncoder, self).default(key) + return None class BlockTypeKey(OpaqueKey): diff --git a/opaque_keys/edx/locator.py b/opaque_keys/edx/locator.py index 94f9a525..e03397af 100644 --- a/opaque_keys/edx/locator.py +++ b/opaque_keys/edx/locator.py @@ -260,9 +260,10 @@ def offering(self): DeprecationWarning, stacklevel=2 ) + if not self.course and not self.run: return None - elif not self.run and self.course: + if not self.run and self.course: return self.course return "/".join([self.course, self.run]) @@ -796,6 +797,7 @@ def _parse_block_ref(cls, block_ref, deprecated=False): is_valid_deprecated = deprecated and cls.DEPRECATED_ALLOWED_ID_RE.match(block_ref) is_valid = cls.ALLOWED_ID_RE.match(block_ref) + # pylint: disable=no-else-return if is_valid or is_valid_deprecated: return block_ref else: @@ -834,6 +836,8 @@ def offering(self): DeprecationWarning, stacklevel=2 ) + + # pylint: disable=no-else-return if not self.course and not self.run: return None elif not self.run and self.course: diff --git a/opaque_keys/edx/tests/test_aside_keys.py b/opaque_keys/edx/tests/test_aside_keys.py index 96539d88..2fe199f9 100644 --- a/opaque_keys/edx/tests/test_aside_keys.py +++ b/opaque_keys/edx/tests/test_aside_keys.py @@ -33,6 +33,7 @@ class TestEncode(TestCase): """Tests of encoding and decoding functions.""" @given(text=ENCODING_TEXT) + @settings(suppress_health_check=[HealthCheck.too_slow]) def test_encode_v1_roundtrip(self, text): """ Test all combinations that include characters we're trying to encode, or using in the encoding. @@ -42,6 +43,7 @@ def test_encode_v1_roundtrip(self, text): self.assertEqual(text, decoded) @given(left=ENCODING_TEXT, right=ENCODING_TEXT) + @settings(suppress_health_check=[HealthCheck.too_slow]) def test_join_v1_roundtrip(self, left, right): assume(not left.endswith(':')) assume('::' not in left) @@ -64,6 +66,7 @@ def test_decode_v1_roundtrip(self, text): self.assertEqual(text, encoded) @given(text=ENCODING_TEXT) + @settings(suppress_health_check=[HealthCheck.too_slow]) def test_encode_v2_roundtrip(self, text): """ Test all combinations that include characters we're trying to encode, or using in the encoding. @@ -87,6 +90,7 @@ def test_decode_v2_roundtrip(self, text): self.assertEqual(text, encoded) @given(left=ENCODING_TEXT, right=ENCODING_TEXT) + @settings(suppress_health_check=[HealthCheck.too_slow]) def test_join_v2_roundtrip(self, left, right): joined = _join_keys_v2(left, right) (_left, _right) = _split_keys_v2(joined) diff --git a/opaque_keys/edx/tests/test_properties.py b/opaque_keys/edx/tests/test_properties.py index ba960b0e..e1b61285 100644 --- a/opaque_keys/edx/tests/test_properties.py +++ b/opaque_keys/edx/tests/test_properties.py @@ -5,7 +5,7 @@ import logging -from hypothesis import strategies, _strategies, given, assume, example +from hypothesis import strategies, _strategies, given, assume, example, HealthCheck, settings from six import text_type from six.moves import range # pylint: disable=redefined-builtin from opaque_keys.edx.keys import CourseKey, UsageKey, DefinitionKey, BlockTypeKey, AssetKey @@ -130,6 +130,7 @@ def perturbed_strings(string_strategy): serialized=strategies.shared(valid_key_string(), key="diff_serial_diff_key"), perturbed=perturbed_strings(strategies.shared(valid_key_string(), key="diff_serial_diff_key")), ) +@settings(suppress_health_check=[HealthCheck.too_slow]) @example( key_type=DefinitionKey, serialized='def-v1:000000000000000000000000+type@-', @@ -195,6 +196,7 @@ def test_perturbed_serializations(key_type, serialized, perturbed): serialized=valid_key_string(), perturbed=valid_key_string(), ) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_unique_deserialization(key_type, serialized, perturbed): assume(serialized != perturbed) diff --git a/requirements/base.txt b/requirements/base.txt index 8e1f96c1..b4e64287 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,7 +4,7 @@ # # make upgrade # -pbr==5.2.0 # via stevedore -pymongo==3.8.0 -six==1.12.0 -stevedore==1.30.1 +pbr==5.4.3 # via stevedore +pymongo==3.9.0 +six==1.13.0 +stevedore==1.31.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index ea7adf16..6700bcfd 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -6,84 +6,89 @@ # alabaster==0.7.12 apipkg==1.5 -asn1crypto==0.24.0 -astroid==1.5.3 +astroid==1.6.6 atomicwrites==1.3.0 -attrs==19.1.0 -babel==2.6.0 -backports.functools-lru-cache==1.5 +attrs==19.3.0 +babel==2.7.0 +backports.functools-lru-cache==1.6.1 bleach==3.1.0 -certifi==2019.3.9 -cffi==1.12.3 +certifi==2019.9.11 +cffi==1.13.2 chardet==3.0.4 click-log==0.3.2 click==7.0 -configparser==3.7.4 -coverage==4.5.3 -coveralls==1.7.0 -cryptography==2.6.1 +configparser==4.0.2 +contextlib2==0.6.0.post1 +coverage==4.5.4 +coveralls==1.8.2 +cryptography==2.8 ddt==1.2.1 docopt==0.6.2 -docutils==0.14 -edx-lint==1.1.2 -edx-sphinx-theme==1.4.0 +docutils==0.15.2 +edx-lint==1.4.1 +edx-sphinx-theme==1.5.0 enum34==1.1.6 -execnet==1.6.0 -filelock==3.0.10 +execnet==1.7.1 +filelock==3.0.12 funcsigs==1.0.2 -futures==3.2.0 ; python_version == "2.7" -hypothesis==4.23.4 +futures==3.3.0 ; python_version == "2.7" +hypothesis==4.44.1 idna==2.8 imagesize==1.1.0 -ipaddress==1.0.22 -isort==4.3.20 -jinja2==2.10.1 -lazy-object-proxy==1.4.1 +importlib-metadata==0.23 +ipaddress==1.0.23 +isort==4.3.21 +jinja2==2.10.3 +lazy-object-proxy==1.4.3 markupsafe==1.1.1 mccabe==0.6.1 mock==3.0.5 more-itertools==5.0.0 -packaging==19.0 -pathlib2==2.3.3 -pbr==5.2.0 +packaging==19.2 +pathlib2==2.3.5 +pbr==5.4.3 pep8==1.7.1 -pip-tools==3.7.0 -pluggy==0.11.0 +pip-tools==4.2.0 +pluggy==0.13.0 py==1.8.0 pycodestyle==2.5.0 pycparser==2.19 -pygments==2.4.0 +pygments==2.4.2 pylint-celery==0.3 -pylint-django==0.7.2 -pylint-plugin-utils==0.5 -pylint==1.7.6 -pymongo==3.8.0 +pylint-django==0.11.1 +pylint-plugin-utils==0.6 +pylint==1.9.5 +pymongo==3.9.0 pyopenssl==19.0.0 -pyparsing==2.4.0 +pyparsing==2.4.5 pytest-cache==1.0 -pytest-cov==2.7.1 -pytest-django==3.4.8 -pytest-forked==1.0.2 +pytest-cov==2.8.1 +pytest-django==3.7.0 +pytest-forked==1.1.3 pytest-pep8==1.0.6 -pytest-pylint==0.14.0 -pytest-xdist==1.28.0 -pytest==4.5.0 -pytz==2019.1 +pytest-pylint==0.14.1 +pytest-xdist==1.30.0 +pytest==4.6.6 +pytz==2019.3 readme-renderer==24.0 -requests==2.21.0 +requests==2.22.0 scandir==1.10.0 singledispatch==3.4.0.3 -six==1.12.0 -snowballstemmer==1.2.1 +six==1.13.0 +snowballstemmer==2.0.0 sphinx==1.8.5 -sphinxcontrib-websupport==1.1.0 -stevedore==1.30.1 +sphinxcontrib-websupport==1.1.2 +stevedore==1.31.0 toml==0.10.0 tox-battery==0.5.1 -tox==3.11.0 -typing==3.6.6 -urllib3[secure]==1.24.3 -virtualenv==16.6.0 +tox==3.14.0 +typing==3.7.4.1 +urllib3[secure]==1.25.7 +virtualenv==16.7.7 wcwidth==0.1.7 webencodings==0.5.1 -wrapt==1.11.1 +wrapt==1.11.2 +zipp==0.6.0 + +# The following packages are considered to be unsafe in a requirements file: +# setuptools==41.6.0 # via sphinx diff --git a/requirements/django.txt b/requirements/django.txt index 7d3b51aa..542ba3ce 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -5,48 +5,53 @@ # make upgrade # apipkg==1.5 -astroid==1.5.3 +astroid==1.6.6 atomicwrites==1.3.0 -attrs==19.1.0 -backports.functools-lru-cache==1.5 +attrs==19.3.0 +backports.functools-lru-cache==1.6.1 click-log==0.3.2 click==7.0 -configparser==3.7.4 -coverage==4.5.3 +configparser==4.0.2 +contextlib2==0.6.0.post1 +coverage==4.5.4 ddt==1.2.1 -edx-lint==1.1.2 +edx-lint==1.4.1 enum34==1.1.6 -execnet==1.6.0 +execnet==1.7.1 funcsigs==1.0.2 -futures==3.2.0 ; python_version == "2.7" -hypothesis==4.23.4 -isort==4.3.20 -lazy-object-proxy==1.4.1 +futures==3.3.0 ; python_version == "2.7" +hypothesis==4.44.1 +importlib-metadata==0.23 +isort==4.3.21 +lazy-object-proxy==1.4.3 mccabe==0.6.1 mock==3.0.5 more-itertools==5.0.0 -pathlib2==2.3.3 -pbr==5.2.0 +packaging==19.2 +pathlib2==2.3.5 +pbr==5.4.3 pep8==1.7.1 -pluggy==0.11.0 +pluggy==0.13.0 py==1.8.0 pycodestyle==2.5.0 pylint-celery==0.3 -pylint-django==0.7.2 -pylint-plugin-utils==0.5 -pylint==1.7.6 -pymongo==3.8.0 +pylint-django==0.11.1 +pylint-plugin-utils==0.6 +pylint==1.9.5 +pymongo==3.9.0 +pyparsing==2.4.5 pytest-cache==1.0 -pytest-cov==2.7.1 -pytest-django==3.4.8 -pytest-forked==1.0.2 +pytest-cov==2.8.1 +pytest-django==3.7.0 +pytest-forked==1.1.3 pytest-pep8==1.0.6 -pytest-pylint==0.14.0 -pytest-xdist==1.28.0 -pytest==4.5.0 +pytest-pylint==0.14.1 +pytest-xdist==1.30.0 +pytest==4.6.6 scandir==1.10.0 singledispatch==3.4.0.3 -six==1.12.0 -stevedore==1.30.1 +six==1.13.0 +stevedore==1.31.0 wcwidth==0.1.7 -wrapt==1.11.1 +wrapt==1.11.2 +zipp==0.6.0 diff --git a/requirements/doc.txt b/requirements/doc.txt index f21195fd..e42ed7b8 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -6,70 +6,76 @@ # alabaster==0.7.12 # via sphinx apipkg==1.5 -astroid==1.5.3 +astroid==1.6.6 atomicwrites==1.3.0 -attrs==19.1.0 -babel==2.6.0 # via sphinx -backports.functools-lru-cache==1.5 +attrs==19.3.0 +babel==2.7.0 # via sphinx +backports.functools-lru-cache==1.6.1 bleach==3.1.0 # via readme-renderer -certifi==2019.3.9 # via requests +certifi==2019.9.11 # via requests chardet==3.0.4 # via requests click-log==0.3.2 click==7.0 -configparser==3.7.4 -coverage==4.5.3 +configparser==4.0.2 +contextlib2==0.6.0.post1 +coverage==4.5.4 ddt==1.2.1 -docutils==0.14 # via readme-renderer, sphinx -edx-lint==1.1.2 -edx-sphinx-theme==1.4.0 +docutils==0.15.2 # via readme-renderer, sphinx +edx-lint==1.4.1 +edx-sphinx-theme==1.5.0 enum34==1.1.6 -execnet==1.6.0 +execnet==1.7.1 funcsigs==1.0.2 -futures==3.2.0 ; python_version == "2.7" -hypothesis==4.23.4 +futures==3.3.0 ; python_version == "2.7" +hypothesis==4.44.1 idna==2.8 # via requests imagesize==1.1.0 # via sphinx -isort==4.3.20 -jinja2==2.10.1 # via sphinx -lazy-object-proxy==1.4.1 +importlib-metadata==0.23 +isort==4.3.21 +jinja2==2.10.3 # via sphinx +lazy-object-proxy==1.4.3 markupsafe==1.1.1 # via jinja2 mccabe==0.6.1 mock==3.0.5 more-itertools==5.0.0 -packaging==19.0 # via sphinx -pathlib2==2.3.3 -pbr==5.2.0 +packaging==19.2 +pathlib2==2.3.5 +pbr==5.4.3 pep8==1.7.1 -pluggy==0.11.0 +pluggy==0.13.0 py==1.8.0 pycodestyle==2.5.0 -pygments==2.4.0 # via readme-renderer, sphinx +pygments==2.4.2 # via readme-renderer, sphinx pylint-celery==0.3 -pylint-django==0.7.2 -pylint-plugin-utils==0.5 -pylint==1.7.6 -pymongo==3.8.0 -pyparsing==2.4.0 # via packaging +pylint-django==0.11.1 +pylint-plugin-utils==0.6 +pylint==1.9.5 +pymongo==3.9.0 +pyparsing==2.4.5 pytest-cache==1.0 -pytest-cov==2.7.1 -pytest-django==3.4.8 -pytest-forked==1.0.2 +pytest-cov==2.8.1 +pytest-django==3.7.0 +pytest-forked==1.1.3 pytest-pep8==1.0.6 -pytest-pylint==0.14.0 -pytest-xdist==1.28.0 -pytest==4.5.0 -pytz==2019.1 # via babel +pytest-pylint==0.14.1 +pytest-xdist==1.30.0 +pytest==4.6.6 +pytz==2019.3 # via babel readme-renderer==24.0 -requests==2.21.0 # via sphinx +requests==2.22.0 # via sphinx scandir==1.10.0 singledispatch==3.4.0.3 -six==1.12.0 -snowballstemmer==1.2.1 # via sphinx +six==1.13.0 +snowballstemmer==2.0.0 # via sphinx sphinx==1.8.5 -sphinxcontrib-websupport==1.1.0 # via sphinx -stevedore==1.30.1 -typing==3.6.6 # via sphinx -urllib3==1.24.3 # via requests +sphinxcontrib-websupport==1.1.2 # via sphinx +stevedore==1.31.0 +typing==3.7.4.1 # via sphinx +urllib3==1.25.7 # via requests wcwidth==0.1.7 webencodings==0.5.1 # via bleach -wrapt==1.11.1 +wrapt==1.11.2 +zipp==0.6.0 + +# The following packages are considered to be unsafe in a requirements file: +# setuptools==41.6.0 # via sphinx diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 9fb70277..050562c3 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -5,5 +5,5 @@ # make upgrade # click==7.0 # via pip-tools -pip-tools==3.7.0 -six==1.12.0 # via pip-tools +pip-tools==4.2.0 +six==1.13.0 # via pip-tools diff --git a/requirements/test.txt b/requirements/test.txt index d17cc7b9..06c49b72 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -5,47 +5,52 @@ # make upgrade # apipkg==1.5 # via execnet -astroid==1.5.3 # via pylint, pylint-celery +astroid==1.6.6 # via pylint, pylint-celery atomicwrites==1.3.0 # via pytest -attrs==19.1.0 # via hypothesis, pytest -backports.functools-lru-cache==1.5 # via astroid, isort, pylint +attrs==19.3.0 # via hypothesis, pytest +backports.functools-lru-cache==1.6.1 # via astroid, isort, pylint click-log==0.3.2 # via edx-lint click==7.0 # via click-log, edx-lint -configparser==3.7.4 # via pylint -coverage==4.5.3 +configparser==4.0.2 # via importlib-metadata, pylint +contextlib2==0.6.0.post1 # via importlib-metadata +coverage==4.5.4 ddt==1.2.1 -edx-lint==1.1.2 +edx-lint==1.4.1 enum34==1.1.6 # via astroid, hypothesis -execnet==1.6.0 # via pytest-cache, pytest-xdist +execnet==1.7.1 # via pytest-cache, pytest-xdist funcsigs==1.0.2 # via mock, pytest -futures==3.2.0 ; python_version == "2.7" # via isort -hypothesis==4.23.4 -isort==4.3.20 # via pylint -lazy-object-proxy==1.4.1 # via astroid +futures==3.3.0 ; python_version == "2.7" # via isort +hypothesis==4.44.1 +importlib-metadata==0.23 # via pluggy, pytest +isort==4.3.21 # via pylint +lazy-object-proxy==1.4.3 # via astroid mccabe==0.6.1 # via pylint mock==3.0.5 -more-itertools==5.0.0 # via pytest -pathlib2==2.3.3 # via pytest -pbr==5.2.0 +more-itertools==5.0.0 # via pytest, zipp +packaging==19.2 # via pytest +pathlib2==2.3.5 # via importlib-metadata, pytest +pbr==5.4.3 pep8==1.7.1 # via pytest-pep8 -pluggy==0.11.0 # via pytest +pluggy==0.13.0 # via pytest py==1.8.0 # via pytest pycodestyle==2.5.0 pylint-celery==0.3 # via edx-lint -pylint-django==0.7.2 # via edx-lint -pylint-plugin-utils==0.5 # via pylint-celery, pylint-django -pylint==1.7.6 # via edx-lint, pylint-celery, pylint-django, pylint-plugin-utils, pytest-pylint -pymongo==3.8.0 +pylint-django==0.11.1 # via edx-lint +pylint-plugin-utils==0.6 # via pylint-celery, pylint-django +pylint==1.9.5 # via edx-lint, pylint-celery, pylint-django, pylint-plugin-utils, pytest-pylint +pymongo==3.9.0 +pyparsing==2.4.5 # via packaging pytest-cache==1.0 # via pytest-pep8 -pytest-cov==2.7.1 -pytest-forked==1.0.2 # via pytest-xdist +pytest-cov==2.8.1 +pytest-forked==1.1.3 # via pytest-xdist pytest-pep8==1.0.6 -pytest-pylint==0.14.0 -pytest-xdist==1.28.0 -pytest==4.5.0 +pytest-pylint==0.14.1 +pytest-xdist==1.30.0 +pytest==4.6.6 scandir==1.10.0 # via pathlib2 singledispatch==3.4.0.3 -six==1.12.0 -stevedore==1.30.1 +six==1.13.0 +stevedore==1.31.0 wcwidth==0.1.7 # via pytest -wrapt==1.11.1 # via astroid +wrapt==1.11.2 # via astroid +zipp==0.6.0 # via importlib-metadata diff --git a/requirements/travis.txt b/requirements/travis.txt index 9a540f09..7fecef73 100644 --- a/requirements/travis.txt +++ b/requirements/travis.txt @@ -4,26 +4,34 @@ # # make upgrade # -asn1crypto==0.24.0 # via cryptography -certifi==2019.3.9 # via requests, urllib3 -cffi==1.12.3 # via cryptography +certifi==2019.9.11 # via requests, urllib3 +cffi==1.13.2 # via cryptography chardet==3.0.4 # via requests -coverage==4.5.3 # via coveralls -coveralls==1.7.0 -cryptography==2.6.1 # via pyopenssl, urllib3 +configparser==4.0.2 # via importlib-metadata +contextlib2==0.6.0.post1 # via importlib-metadata +coverage==4.5.4 # via coveralls +coveralls==1.8.2 +cryptography==2.8 # via pyopenssl, urllib3 docopt==0.6.2 # via coveralls enum34==1.1.6 # via cryptography -filelock==3.0.10 # via tox +filelock==3.0.12 # via tox idna==2.8 # via requests, urllib3 -ipaddress==1.0.22 # via cryptography, urllib3 -pluggy==0.11.0 # via tox +importlib-metadata==0.23 # via pluggy, tox +ipaddress==1.0.23 # via cryptography, urllib3 +more-itertools==5.0.0 # via zipp +packaging==19.2 # via tox +pathlib2==2.3.5 # via importlib-metadata +pluggy==0.13.0 # via tox py==1.8.0 # via tox pycparser==2.19 # via cffi pyopenssl==19.0.0 # via urllib3 -requests==2.21.0 # via coveralls -six==1.12.0 # via cryptography, pyopenssl, tox +pyparsing==2.4.5 # via packaging +requests==2.22.0 # via coveralls +scandir==1.10.0 # via pathlib2 +six==1.13.0 # via cryptography, more-itertools, packaging, pathlib2, pyopenssl, tox toml==0.10.0 # via tox tox-battery==0.5.1 -tox==3.11.0 -urllib3[secure]==1.24.3 # via coveralls, requests -virtualenv==16.6.0 # via tox +tox==3.14.0 +urllib3[secure]==1.25.7 # via coveralls, requests +virtualenv==16.7.7 # via tox +zipp==0.6.0 # via importlib-metadata diff --git a/setup.py b/setup.py index 831fdb4a..a7ca5971 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", ], # We are including the tests because other libraries do use mixins from them. @@ -23,7 +24,7 @@ 'pymongo>=2.7.2,<4.0.0' ], extras_require={ - 'django': ['Django>=1.8,<2.0'] + 'django': ['Django>=1.11,<2.0;python_version<"3"', 'Django>=1.11;python_version>"3"'] }, entry_points={ 'opaque_keys.testing': [ diff --git a/tox.ini b/tox.ini index 3eb764e2..ef46d1a3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,31 @@ [tox] -envlist = py{27,36},django{111} +envlist = py{27,35}-django{111},py{35,36}-django{20,21,22},quality skip_missing_interpreters = True [testenv] +deps = + django111: Django>=1.11,<2.0 + django20: Django>=2.0,<2.1 + django21: Django>=2.1,<2.2 + django22: Django>=2.2,<2.3 + -r{toxinidir}/requirements/django.txt +commands = pytest --disable-pytest-warnings --nomigrations {posargs} + + +[testenv:pytest-py27] +basepython = python2.7 deps = -r{toxinidir}/requirements/test.txt commands = pytest --disable-pytest-warnings --ignore=opaque_keys/edx/django {posargs} -[testenv:django111] + +[testenv:pytest-py35] +basepython = python3.5 deps = - django>=1.11,<2.0 - -r{toxinidir}/requirements/django.txt -commands = pytest --disable-pytest-warnings --nomigrations {posargs} + -r{toxinidir}/requirements/test.txt +commands = pytest --disable-pytest-warnings --ignore=opaque_keys/edx/django {posargs} + +[testenv:quality] +commands= + pycodestyle --config=.pep8 opaque_keys + pylint --rcfile=pylintrc opaque_keys \ No newline at end of file