Skip to content

Commit

Permalink
Upgrade Django to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhwaniartefact authored Jan 23, 2024
1 parent 43328a1 commit efe4940
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 75 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
"3.8",
"3.9",
"3.10",
"3.11",
]
include:
- rule: "storage-service"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: "1.15.0"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
args: [--target-version, "4.2"]
- repo: https://github.com/psf/black
rev: "23.10.1"
hooks:
Expand Down
48 changes: 22 additions & 26 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ asgiref==3.7.2
# via
# -r requirements.txt
# django
attrs==23.1.0
attrs==23.2.0
# via
# -r requirements.txt
# jsonschema
Expand Down Expand Up @@ -51,7 +51,7 @@ click==8.1.7
# pip-tools
colorama==0.4.6
# via tox
coverage[toml]==7.3.2
coverage[toml]==7.4.0
# via
# -r requirements-dev.in
# pytest-cov
Expand All @@ -61,9 +61,9 @@ cryptography==41.0.7
# josepy
# mozilla-django-oidc
# pyopenssl
distlib==0.3.7
distlib==0.3.8
# via virtualenv
django==3.2.23
django==4.2.9
# via
# -r requirements.txt
# django-auth-ldap
Expand Down Expand Up @@ -100,7 +100,7 @@ gearman3 @ git+https://github.com/artefactual-labs/python-gearman.git@b68efc868c
# via -r requirements.txt
gevent==23.9.1
# via -r requirements.txt
greenlet==3.0.1
greenlet==3.0.3
# via
# -r requirements.txt
# gevent
Expand All @@ -110,7 +110,7 @@ idna==3.6
# via
# -r requirements.txt
# requests
importlib-metadata==6.8.0
importlib-metadata==7.0.1
# via
# -r requirements.txt
# build
Expand All @@ -127,15 +127,15 @@ josepy==1.14.0
# via
# -r requirements.txt
# mozilla-django-oidc
jsonschema==4.20.0
jsonschema==4.21.0
# via -r requirements.txt
jsonschema-specifications==2023.11.1
jsonschema-specifications==2023.12.1
# via
# -r requirements.txt
# jsonschema
lazy-paged-sequence==0.3
# via -r requirements.txt
lxml==4.9.3
lxml==5.1.0
# via
# -r requirements.txt
# ammcpc
Expand All @@ -145,13 +145,13 @@ metsrw==0.5.0
# via -r requirements.txt
mockldap @ git+https://github.com/artefactual-labs/[email protected]
# via -r requirements-dev.in
mozilla-django-oidc==3.0.0
mozilla-django-oidc==4.0.0
# via -r requirements.txt
mysqlclient==2.2.0
mysqlclient==2.2.1
# via
# -r requirements.txt
# agentarchives
olefile==0.46
olefile==0.47
# via
# -r requirements.txt
# opf-fido
Expand All @@ -167,7 +167,7 @@ packaging==23.2
# tox
pip-tools==7.3.0
# via -r requirements.txt
platformdirs==4.0.0
platformdirs==4.1.0
# via
# tox
# virtualenv
Expand Down Expand Up @@ -202,7 +202,7 @@ pyproject-hooks==1.0.0
# via
# -r requirements.txt
# build
pytest==7.4.3
pytest==7.4.4
# via
# -r requirements-dev.in
# pytest-cov
Expand Down Expand Up @@ -234,11 +234,7 @@ python-mimeparse==1.6.0
# via
# -r requirements.txt
# django-tastypie
pytz==2023.3.post1
# via
# -r requirements.txt
# django
referencing==0.31.0
referencing==0.32.1
# via
# -r requirements.txt
# jsonschema
Expand All @@ -251,7 +247,7 @@ requests==2.31.0
# mozilla-django-oidc
# opf-fido
# python-cas
rpds-py==0.13.1
rpds-py==0.17.1
# via
# -r requirements.txt
# jsonschema
Expand All @@ -276,21 +272,21 @@ tomli==2.0.1
# pyproject-hooks
# pytest
# tox
tox==4.11.4
tox==4.12.1
# via -r requirements-dev.in
typing-extensions==4.8.0
typing-extensions==4.9.0
# via
# -r requirements.txt
# asgiref
unidecode==1.3.7
unidecode==1.3.8
# via -r requirements.txt
urllib3==2.1.0
# via
# -r requirements.txt
# amclient
# elasticsearch
# requests
virtualenv==20.24.7
virtualenv==20.25.0
# via tox
wheel==0.42.0
# via
Expand All @@ -313,11 +309,11 @@ zope-interface==6.1
# gevent

# The following packages are considered to be unsafe in a requirements file:
pip==23.3.1
pip==23.3.2
# via
# -r requirements.txt
# pip-tools
setuptools==69.0.2
setuptools==69.0.3
# via
# -r requirements.txt
# pip-tools
Expand Down
6 changes: 1 addition & 5 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
git+https://github.com/Brown-University-Library/django-shibboleth-remoteuser.git@962f6f9818683ef5f6432f091d22945e54b82592#egg=django-shibboleth-remoteuser
Django>=3.2,<4
Django>=4.2,<5
agentarchives
amclient
ammcpc
Expand All @@ -9,7 +9,6 @@ clamd
django-autoslug
django-csp
django-forms-bootstrap
django-prometheus>=2.2,<2.3; python_version == "3.6"
django-prometheus
django-tastypie
elasticsearch>=6.0.0,<7.0.0
Expand All @@ -27,10 +26,8 @@ pip
pip-tools
prometheus_client
python-dateutil
requests~=2.27; python_version == "3.6"
requests
unidecode
whitenoise>=5.3.0,<6.0; python_version == "3.6"
whitenoise

# Required by LDAP authentication
Expand All @@ -41,5 +38,4 @@ python-ldap
django-cas-ng

# Required for OpenID Connect authentication
mozilla-django-oidc~=2.0; python_version == "3.6"
mozilla-django-oidc
34 changes: 16 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ammcpc==0.2.0
# via -r requirements.in
asgiref==3.7.2
# via django
attrs==23.1.0
attrs==23.2.0
# via
# jsonschema
# referencing
Expand All @@ -37,7 +37,7 @@ cryptography==41.0.7
# josepy
# mozilla-django-oidc
# pyopenssl
django==3.2.23
django==4.2.9
# via
# -r requirements.in
# django-auth-ldap
Expand Down Expand Up @@ -66,13 +66,13 @@ gearman3 @ git+https://github.com/artefactual-labs/python-gearman.git@b68efc868c
# via -r requirements.in
gevent==23.9.1
# via -r requirements.in
greenlet==3.0.1
greenlet==3.0.3
# via gevent
gunicorn==21.2.0
# via -r requirements.in
idna==3.6
# via requests
importlib-metadata==6.8.0
importlib-metadata==7.0.1
# via
# -r requirements.in
# build
Expand All @@ -82,25 +82,25 @@ inotify-simple==1.3.5
# via -r requirements.in
josepy==1.14.0
# via mozilla-django-oidc
jsonschema==4.20.0
jsonschema==4.21.0
# via -r requirements.in
jsonschema-specifications==2023.11.1
jsonschema-specifications==2023.12.1
# via jsonschema
lazy-paged-sequence==0.3
# via -r requirements.in
lxml==4.9.3
lxml==5.1.0
# via
# -r requirements.in
# ammcpc
# metsrw
# python-cas
metsrw==0.5.0
# via -r requirements.in
mozilla-django-oidc==3.0.0
mozilla-django-oidc==4.0.0
# via -r requirements.in
mysqlclient==2.2.0
mysqlclient==2.2.1
# via agentarchives
olefile==0.46
olefile==0.47
# via opf-fido
opf-fido==1.6.1
# via -r requirements.in
Expand Down Expand Up @@ -138,9 +138,7 @@ python-ldap==3.4.4
# django-auth-ldap
python-mimeparse==1.6.0
# via django-tastypie
pytz==2023.3.post1
# via django
referencing==0.31.0
referencing==0.32.1
# via
# jsonschema
# jsonschema-specifications
Expand All @@ -152,7 +150,7 @@ requests==2.31.0
# mozilla-django-oidc
# opf-fido
# python-cas
rpds-py==0.13.1
rpds-py==0.17.1
# via
# jsonschema
# referencing
Expand All @@ -168,9 +166,9 @@ tomli==2.0.1
# build
# pip-tools
# pyproject-hooks
typing-extensions==4.8.0
typing-extensions==4.9.0
# via asgiref
unidecode==1.3.7
unidecode==1.3.8
# via -r requirements.in
urllib3==2.1.0
# via
Expand All @@ -191,11 +189,11 @@ zope-interface==6.1
# via gevent

# The following packages are considered to be unsafe in a requirements file:
pip==23.3.1
pip==23.3.2
# via
# -r requirements.in
# pip-tools
setuptools==69.0.2
setuptools==69.0.3
# via
# pip-tools
# zope-event
Expand Down
6 changes: 3 additions & 3 deletions src/MCPClient/tests/test_archivematicaClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def test_handle_batch_task_replaces_non_ascii_arguments(mocker):
},
)

# This is the only function that uses the arguments after the replacements
_parse_command_line = mocker.patch("archivematicaClient._parse_command_line")

# The mocked module will not have a `concurrent_instances` attribute
mocker.patch(
"importlib.import_module", return_value=mocker.MagicMock(spec=["call"])
)

# This is the only function that uses the arguments after the replacements
_parse_command_line = mocker.patch("archivematicaClient._parse_command_line")

# Mock the two parameters sent to handle_batch_task
gearman_job_mock = mocker.Mock(task=b"task name")
supported_modules_mock = mocker.Mock(**{"get.side_effect": "some_module_name"})
Expand Down
2 changes: 1 addition & 1 deletion src/MCPClient/tests/test_load_premis_events_from_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_parse_datetime_with_valid_datetime_and_timezone():
result = load_premis_events_from_xml.parse_datetime("2019-09-24T16:54:21+04:00")
assert (2019, 9, 24) == (result.year, result.month, result.day)
assert (16, 54, 21) == (result.hour, result.minute, result.second)
assert "+0400" == result.tzname()
assert "UTC+04:00" == result.tzname()


def test_parse_datetime_with_empty_string():
Expand Down
Loading

0 comments on commit efe4940

Please sign in to comment.