Skip to content

Commit

Permalink
Merge pull request #304 from openedx/upgrade-pymongo
Browse files Browse the repository at this point in the history
chore: upgrade pymongo.
  • Loading branch information
farhan authored Apr 25, 2024
2 parents bd82bb0 + 82c3b20 commit 0e562f0
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 55 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.9.0

* Upgrade pymongo to 4.4. It contains few breaking changes.

# 2.6.0

* Added support for python 3.12
Expand Down
2 changes: 1 addition & 1 deletion opaque_keys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from stevedore.enabled import EnabledExtensionManager
from typing_extensions import Self # For python 3.11 plus, can just use "from typing import Self"

__version__ = '2.8.0'
__version__ = '2.9.0'


class InvalidKeyError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions opaque_keys/edx/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def version(self) -> str | None:
DeprecationWarning,
stacklevel=2
)
return self.version_guid
return self.version_guid # type: ignore

@property
def offering(self):
Expand Down Expand Up @@ -474,7 +474,7 @@ def __init__(
raise ValueError(f"Invalid run. Should be '{self.RUN}' or None.")

if version_guid:
version_guid = self.as_object_id(version_guid)
version_guid = self.as_object_id(version_guid) # type: ignore

for name, value in [['org', org], ['library', library], ['branch', branch]]:
if not (value is None or self.ALLOWED_ID_RE.match(value)):
Expand Down
2 changes: 1 addition & 1 deletion opaque_keys/edx/tests/test_asset_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_deprecated_son(self, key_cls, prefix, tag, source):
source_key = key_cls(*source, deprecated=True)
son = source_key.to_deprecated_son(prefix=prefix, tag=tag)
self.assertEqual(
son.keys(),
list(son.keys()),
[prefix + key for key in ('tag', 'org', 'course', 'category', 'name', 'revision')]
)

Expand Down
2 changes: 1 addition & 1 deletion opaque_keys/edx/tests/test_block_usage_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_map_into_course_location(self, deprecated_source, deprecated_dest):
def test_to_deprecated_son(self, key_cls, prefix, tag, source):
source_key = key_cls(*source, deprecated=True)
son = source_key.to_deprecated_son(prefix=prefix, tag=tag)
self.assertEqual(son.keys(),
self.assertEqual(list(son.keys()),
[prefix + key for key in ('tag', 'org', 'course', 'category', 'name', 'revision')])

self.assertEqual(son[prefix + 'tag'], tag)
Expand Down
4 changes: 2 additions & 2 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Core requirements for using this application
-c constraints.txt

# migration guide here: https://pymongo.readthedocs.io/en/4.0/migrate-to-pymongo4.html
pymongo>=2.7.2,<4.0
# https://pymongo.readthedocs.io/en/4.4.0/migrate-to-pymongo4.html#son-items-now-returns-dict-items-object
pymongo>=2.7.2,<4.4.1
stevedore>=0.14.1
typing-extensions
6 changes: 4 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#
# make upgrade
#
dnspython==2.6.1
# via pymongo
pbr==6.0.0
# via stevedore
pymongo==3.13.0
pymongo==4.4.0
# via -r requirements/base.in
stevedore==5.2.0
# via -r requirements/base.in
typing-extensions==4.10.0
typing-extensions==4.11.0
# via -r requirements/base.in
10 changes: 5 additions & 5 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
coverage==7.4.4
coverage==7.5.0
# via -r requirements/ci.in
distlib==0.3.8
# via virtualenv
filelock==3.13.3
filelock==3.13.4
# via
# tox
# virtualenv
packaging==24.0
# via
# pyproject-api
# tox
platformdirs==4.2.0
platformdirs==4.2.1
# via
# tox
# virtualenv
pluggy==1.4.0
pluggy==1.5.0
# via tox
pyproject-api==1.6.1
# via tox
Expand All @@ -36,5 +36,5 @@ tomli==2.0.1
# tox
tox==4.14.2
# via -r requirements/ci.in
virtualenv==20.25.1
virtualenv==20.26.0
# via tox
28 changes: 16 additions & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ click-log==0.4.0
# via
# -r requirements/doc.txt
# edx-lint
code-annotations==1.7.0
code-annotations==1.8.0
# via
# -r requirements/doc.txt
# edx-lint
colorama==0.4.6
# via
# -r requirements/ci.txt
# tox
coverage[toml]==7.4.4
coverage[toml]==7.5.0
# via
# -r requirements/ci.txt
# -r requirements/doc.txt
Expand All @@ -85,6 +85,10 @@ distlib==0.3.8
# via
# -r requirements/ci.txt
# virtualenv
dnspython==2.6.1
# via
# -r requirements/doc.txt
# pymongo
docutils==0.19
# via
# -r requirements/doc.txt
Expand All @@ -93,23 +97,23 @@ docutils==0.19
# sphinx
edx-lint==5.3.6
# via -r requirements/doc.txt
exceptiongroup==1.2.0
exceptiongroup==1.2.1
# via
# -r requirements/doc.txt
# hypothesis
# pytest
execnet==2.0.2
execnet==2.1.1
# via
# -r requirements/doc.txt
# pytest-xdist
filelock==3.13.3
filelock==3.13.4
# via
# -r requirements/ci.txt
# tox
# virtualenv
hypothesis==6.100.0
hypothesis==6.100.1
# via -r requirements/doc.txt
idna==3.6
idna==3.7
# via
# -r requirements/doc.txt
# requests
Expand Down Expand Up @@ -173,14 +177,14 @@ pbr==6.0.0
# stevedore
pip-tools==7.4.1
# via -r requirements/pip-tools.txt
platformdirs==4.2.0
platformdirs==4.2.1
# via
# -r requirements/ci.txt
# -r requirements/doc.txt
# pylint
# tox
# virtualenv
pluggy==1.4.0
pluggy==1.5.0
# via
# -r requirements/ci.txt
# -r requirements/doc.txt
Expand Down Expand Up @@ -219,7 +223,7 @@ pylint-plugin-utils==0.8.2
# -r requirements/doc.txt
# pylint-celery
# pylint-django
pymongo==3.13.0
pymongo==4.4.0
# via -r requirements/doc.txt
pyproject-api==1.6.1
# via
Expand Down Expand Up @@ -332,7 +336,7 @@ tomlkit==0.12.4
# pylint
tox==4.14.2
# via -r requirements/ci.txt
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# -r requirements/doc.txt
# astroid
Expand All @@ -343,7 +347,7 @@ urllib3==2.2.1
# via
# -r requirements/doc.txt
# requests
virtualenv==20.25.1
virtualenv==20.26.0
# via
# -r requirements/ci.txt
# tox
Expand Down
22 changes: 13 additions & 9 deletions requirements/django-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ click-log==0.4.0
# via
# -r requirements/test.txt
# edx-lint
code-annotations==1.7.0
code-annotations==1.8.0
# via
# -r requirements/test.txt
# edx-lint
coverage[toml]==7.4.4
coverage[toml]==7.5.0
# via
# -r requirements/test.txt
# pytest-cov
Expand All @@ -37,18 +37,22 @@ dill==0.3.8
# via
# -r requirements/test.txt
# pylint
dnspython==2.6.1
# via
# -r requirements/test.txt
# pymongo
edx-lint==5.3.6
# via -r requirements/test.txt
exceptiongroup==1.2.0
exceptiongroup==1.2.1
# via
# -r requirements/test.txt
# hypothesis
# pytest
execnet==2.0.2
execnet==2.1.1
# via
# -r requirements/test.txt
# pytest-xdist
hypothesis==6.100.0
hypothesis==6.100.1
# via -r requirements/test.txt
iniconfig==2.0.0
# via
Expand Down Expand Up @@ -86,11 +90,11 @@ pbr==6.0.0
# via
# -r requirements/test.txt
# stevedore
platformdirs==4.2.0
platformdirs==4.2.1
# via
# -r requirements/test.txt
# pylint
pluggy==1.4.0
pluggy==1.5.0
# via
# -r requirements/test.txt
# pytest
Expand All @@ -116,7 +120,7 @@ pylint-plugin-utils==0.8.2
# -r requirements/test.txt
# pylint-celery
# pylint-django
pymongo==3.13.0
pymongo==4.4.0
# via -r requirements/test.txt
pytest==8.1.1
# via
Expand Down Expand Up @@ -165,7 +169,7 @@ tomlkit==0.12.4
# via
# -r requirements/test.txt
# pylint
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# -r requirements/test.txt
# astroid
Expand Down
24 changes: 14 additions & 10 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ click-log==0.4.0
# via
# -r requirements/test.txt
# edx-lint
code-annotations==1.7.0
code-annotations==1.8.0
# via
# -r requirements/test.txt
# edx-lint
coverage[toml]==7.4.4
coverage[toml]==7.5.0
# via
# -r requirements/test.txt
# pytest-cov
Expand All @@ -51,25 +51,29 @@ dill==0.3.8
# via
# -r requirements/test.txt
# pylint
dnspython==2.6.1
# via
# -r requirements/test.txt
# pymongo
docutils==0.19
# via
# pydata-sphinx-theme
# readme-renderer
# sphinx
edx-lint==5.3.6
# via -r requirements/test.txt
exceptiongroup==1.2.0
exceptiongroup==1.2.1
# via
# -r requirements/test.txt
# hypothesis
# pytest
execnet==2.0.2
execnet==2.1.1
# via
# -r requirements/test.txt
# pytest-xdist
hypothesis==6.100.0
hypothesis==6.100.1
# via -r requirements/test.txt
idna==3.6
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
Expand Down Expand Up @@ -116,11 +120,11 @@ pbr==6.0.0
# via
# -r requirements/test.txt
# stevedore
platformdirs==4.2.0
platformdirs==4.2.1
# via
# -r requirements/test.txt
# pylint
pluggy==1.4.0
pluggy==1.5.0
# via
# -r requirements/test.txt
# pytest
Expand Down Expand Up @@ -154,7 +158,7 @@ pylint-plugin-utils==0.8.2
# -r requirements/test.txt
# pylint-celery
# pylint-django
pymongo==3.13.0
pymongo==4.4.0
# via -r requirements/test.txt
pytest==8.1.1
# via
Expand Down Expand Up @@ -229,7 +233,7 @@ tomlkit==0.12.4
# via
# -r requirements/test.txt
# pylint
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# -r requirements/test.txt
# astroid
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ wheel==0.43.0
# The following packages are considered to be unsafe in a requirements file:
pip==24.0
# via -r requirements/pip.in
setuptools==69.2.0
setuptools==69.5.1
# via -r requirements/pip.in
Loading

0 comments on commit 0e562f0

Please sign in to comment.