Skip to content

Commit

Permalink
Merge pull request #166 from edx/usamasadiq/remove-constraints
Browse files Browse the repository at this point in the history
Remove constraints
  • Loading branch information
UsamaSadiq committed Jan 29, 2021
2 parents 6b60404 + 4c8ccbc commit f218850
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ deploy:
secure: cnCf0zDyTEJycCDcxhH1GsvOWNGImjwc8WIrD/D5Hsk7p0IeMaEjc/t6gc1LO2iQKGlZq/BLDxUBmsEbrQUD1wvSBg/J+9Ji6yn9jJ87X6QSNq+Xy0brLe9RAeMElG3OLqbj6FHRMzk2EmOEJXI9ATqlXfdqFwgKCYrvf2GT2Ug=
on:
tags: true
python: '3.5'
python: '3.8'
condition: $TOXENV = django22
distributions: sdist bdist_wheel
repo: edx/opaque-keys
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.2.0

* Dropped support for Python3.5
* Added support for Django 3.0 & Django 3.1

# 2.0.2

* Fixed django warnings
Expand Down
8 changes: 0 additions & 8 deletions opaque_keys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
"""
from abc import ABCMeta, abstractmethod
from functools import total_ordering
from six import (
iteritems,
python_2_unicode_compatible,
text_type,
viewkeys,
viewitems,
with_metaclass,
)
from stevedore.enabled import EnabledExtensionManager

# pylint: disable=wrong-import-order
Expand Down
2 changes: 1 addition & 1 deletion opaque_keys/edx/django/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def to_python(self, value):
if value is self.Empty or value is None:
return None

error_message = "%s is not an instance of six.string_types or %s" % (value, self.KEY_CLASS)
error_message = "%s is not an instance of str or %s" % (value, self.KEY_CLASS)
assert isinstance(value, (str,) + (self.KEY_CLASS,)), error_message
if value == '':
# handle empty string for models being created w/o fields populated
Expand Down
2 changes: 1 addition & 1 deletion opaque_keys/edx/tests/test_course_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_course_constructor_version_guid(self):
'mit.eecs+' + CourseLocator.BRANCH_PREFIX + '@this+' + CourseLocator.BRANCH_PREFIX + '@that',
'mit.eecs+' + CourseLocator.BRANCH_PREFIX + '@this+' + CourseLocator.BRANCH_PREFIX,
'mit.eecs+' + CourseLocator.BRANCH_PREFIX + '@this ',
'mit.eecs+' + CourseLocator.BRANCH_PREFIX + '@th%is ', # pylint: disable=unicode-format-string
'mit.eecs+' + CourseLocator.BRANCH_PREFIX + '@th%is ',
'\ufffd',
)
def test_course_constructor_bad_package_id(self, bad_id):
Expand Down
4 changes: 2 additions & 2 deletions opaque_keys/tests/test_opaque_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ def test_namespace_from_string(self):
self.assertEqual(base_key._to_string(), '15') # pylint: disable=protected-access
self.assertEqual(len(base_key), len('base10:15'))

dict_key = DummyKey.from_string('dict:{"foo": "bar"}') # pylint: disable=unicode-format-string
dict_key = DummyKey.from_string('dict:{"foo": "bar"}')
self.assertIsInstance(dict_key, DictKey)
self.assertEqual(dict_key.value, {"foo": "bar"})
self.assertEqual(dict_key._to_string(), '{"foo": "bar"}') # pylint: disable=protected-access
self.assertEqual(len(dict_key), len('dict:{"foo": "bar"}')) # pylint: disable=unicode-format-string
self.assertEqual(len(dict_key), len('dict:{"foo": "bar"}'))

def test_bad_keys(self):
with self.assertRaises(InvalidKeyError):
Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
-c constraints.txt

pymongo>=2.7.2
six>=1.10.0
stevedore>=0.14.1
2 changes: 0 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ pbr==5.5.1
# via stevedore
pymongo==3.11.2
# via -r requirements/base.in
six==1.15.0
# via -r requirements/base.in
stevedore==3.3.0
# via -r requirements/base.in
17 changes: 5 additions & 12 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.

# stay on LTS release
Django<2.3

# pytest>=5.6.0 fails to fetch the tests and hence all the tests fail
pytest<5.6.0

# pytest command fails if pytest > 5.3 is used
# Look into https://github.com/pytest-dev/pytest/issues/6925
pytest<=5.3

# version >= 0.16 requires pytest >= 5.4
pytest-pylint<0.16

# pytest-xdist>=2.0.0 removes some aliases and until pytest-django>=3.10.0 is released, this will break tests.
pytest-xdist==1.34.0

# version 4.0.0 requires pytest >= 5.4.0
pytest-django<4.0.0
pytest-xdist<2.0.0
60 changes: 45 additions & 15 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ babel==2.9.0
# via
# -r requirements/doc.txt
# sphinx
bleach==3.2.2
bleach==3.2.3
# via
# -r requirements/doc.txt
# readme-renderer
Expand All @@ -53,9 +53,14 @@ click==7.1.2
# -r requirements/doc.txt
# -r requirements/pip-tools.txt
# click-log
# code-annotations
# edx-lint
# pip-tools
coverage==5.3.1
code-annotations==1.0.2
# via
# -r requirements/doc.txt
# edx-lint
coverage==5.4
# via
# -r requirements/doc.txt
# -r requirements/travis.txt
Expand All @@ -69,6 +74,12 @@ distlib==0.3.1
# via
# -r requirements/travis.txt
# virtualenv
django==2.2.17
# via
# -c requirements/constraints.txt
# -r requirements/doc.txt
# code-annotations
# edx-lint
docopt==0.6.2
# via
# -r requirements/travis.txt
Expand All @@ -78,11 +89,11 @@ docutils==0.16
# -r requirements/doc.txt
# readme-renderer
# sphinx
edx-lint==1.6
edx-lint==3.0.2
# via -r requirements/doc.txt
edx-sphinx-theme==1.6.1
# via -r requirements/doc.txt
execnet==1.7.1
execnet==1.8.0
# via
# -r requirements/doc.txt
# pytest-cache
Expand All @@ -92,7 +103,7 @@ filelock==3.0.12
# -r requirements/travis.txt
# tox
# virtualenv
hypothesis==6.0.2
hypothesis==6.0.4
# via -r requirements/doc.txt
idna==2.10
# via
Expand All @@ -110,6 +121,7 @@ isort==5.7.0
jinja2==2.11.2
# via
# -r requirements/doc.txt
# code-annotations
# sphinx
lazy-object-proxy==1.4.3
# via
Expand Down Expand Up @@ -171,7 +183,7 @@ pylint-celery==0.3
# via
# -r requirements/doc.txt
# edx-lint
pylint-django==2.3.0
pylint-django==2.4.2
# via
# -r requirements/doc.txt
# edx-lint
Expand Down Expand Up @@ -207,15 +219,13 @@ pytest-forked==1.3.0
# pytest-xdist
pytest-pep8==1.0.6
# via -r requirements/doc.txt
pytest-pylint==0.15.1
# via
# -c requirements/constraints.txt
# -r requirements/doc.txt
pytest-pylint==0.18.0
# via -r requirements/doc.txt
pytest-xdist==1.34.0
# via
# -c requirements/constraints.txt
# -r requirements/doc.txt
pytest==5.3.0
pytest==5.4.3
# via
# -c requirements/constraints.txt
# -r requirements/doc.txt
Expand All @@ -225,10 +235,19 @@ pytest==5.3.0
# pytest-pep8
# pytest-pylint
# pytest-xdist
python-slugify==4.0.1
# via
# -r requirements/doc.txt
# code-annotations
pytz==2020.5
# via
# -r requirements/doc.txt
# babel
# django
pyyaml==5.4.1
# via
# -r requirements/doc.txt
# code-annotations
readme-renderer==28.0
# via -r requirements/doc.txt
requests==2.25.1
Expand All @@ -249,7 +268,7 @@ six==1.15.0
# readme-renderer
# tox
# virtualenv
snowballstemmer==2.0.0
snowballstemmer==2.1.0
# via
# -r requirements/doc.txt
# sphinx
Expand Down Expand Up @@ -285,21 +304,32 @@ sphinxcontrib-serializinghtml==1.1.4
# via
# -r requirements/doc.txt
# sphinx
sqlparse==0.4.1
# via
# -r requirements/doc.txt
# django
stevedore==3.3.0
# via -r requirements/doc.txt
# via
# -r requirements/doc.txt
# code-annotations
text-unidecode==1.3
# via
# -r requirements/doc.txt
# python-slugify
toml==0.10.2
# via
# -r requirements/doc.txt
# -r requirements/travis.txt
# pylint
# pytest-pylint
# tox
tox-battery==0.6.1
# via -r requirements/travis.txt
tox==3.21.2
tox==3.21.3
# via
# -r requirements/travis.txt
# tox-battery
urllib3==1.26.2
urllib3==1.26.3
# via
# -r requirements/doc.txt
# -r requirements/travis.txt
Expand Down

0 comments on commit f218850

Please sign in to comment.