Skip to content

Commit

Permalink
feat!: upgrade to django42
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairshakoorarbisoft authored and iamsobanjaved committed Mar 20, 2024
1 parent 0275ddc commit c5d0b6a
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django32, django42, quality, pii_check]
toxenv: [django42, quality, pii_check]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ migrate: ## apply database migrations
html_coverage: ## generate and view HTML coverage report
coverage html && open htmlcov/index.html

define COMMON_CONSTRAINTS_TEMP_COMMENT
# This is a temporary solution to override the real common_constraints.txt\n# In edx-lint, until the pyjwt constraint in edx-lint has been removed.\n# See BOM-2721 for more details.\n# Below is the copied and edited version of common_constraints\n
endef

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
Expand Down
5 changes: 5 additions & 0 deletions edx_exams/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ def root(*path_fragments):

USE_TZ = True

# Django 4.0+ uses zoneinfo if this is not set. We can remove this and
# migrate to zoneinfo after Django 4.2 upgrade. See more on following url
# https://docs.djangoproject.com/en/4.2/releases/4.0/#zoneinfo-default-timezone-implementation
USE_DEPRECATED_PYTZ = True

LOCALE_PATHS = (
root('conf', 'locale'),
)
Expand Down
3 changes: 3 additions & 0 deletions edx_exams/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@

# EMAIL CONFIGURATION
EMAIL_BACKEND = 'django_ses.SESBackend'

if django.VERSION[0] >= 4: # for greater than django 3.2 use schemes.
CSRF_TRUSTED_ORIGINS = CSRF_TRUSTED_ORIGINS_WITH_SCHEME
7 changes: 4 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ attrs==23.2.0
# -r requirements/base.in
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via django
bleach==6.1.0
# via lti-consumer-xblock
boto3==1.34.45
Expand Down Expand Up @@ -53,9 +55,9 @@ defusedxml==0.8.0rc2
# via
# python3-openid
# social-auth-core
django==3.2.24
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-appconf
# django-config-models
Expand Down Expand Up @@ -270,7 +272,6 @@ python3-openid==3.2.0
pytz==2024.1
# via
# -r requirements/base.in
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down
6 changes: 5 additions & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints

# A central location for most common version constraints
# (across edx repos) for pip-installation.
Expand All @@ -14,7 +18,7 @@


# using LTS django version
Django<4.0
Django<5.0

# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process.
# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html
Expand Down
17 changes: 5 additions & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ attrs==23.2.0
# -r requirements/validation.txt
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via
# -r requirements/validation.txt
# django
bleach==6.1.0
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -105,7 +109,6 @@ cryptography==42.0.3
# via
# -r requirements/validation.txt
# pyjwt
# secretstorage
# social-auth-core
ddt==1.7.1
# via -r requirements/validation.txt
Expand All @@ -124,7 +127,7 @@ distlib==0.3.8
# via
# -r requirements/validation.txt
# virtualenv
django==3.2.24
django==4.2.11
# via
# -r requirements/validation.txt
# django-appconf
Expand Down Expand Up @@ -334,11 +337,6 @@ jaraco-classes==3.3.1
# via
# -r requirements/validation.txt
# keyring
jeepney==0.8.0
# via
# -r requirements/validation.txt
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -569,7 +567,6 @@ python3-openid==3.2.0
pytz==2024.1
# via
# -r requirements/validation.txt
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -625,10 +622,6 @@ s3transfer==0.10.0
# via
# -r requirements/validation.txt
# boto3
secretstorage==3.3.3
# via
# -r requirements/validation.txt
# keyring
semantic-version==2.10.0
# via
# -r requirements/validation.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==3.2.24
django==4.2.11
16 changes: 6 additions & 10 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ attrs==23.2.0
# openedx-events
babel==2.14.0
# via sphinx
backports-zoneinfo==0.2.1
# via
# -r requirements/test.txt
# django
bleach==6.1.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -104,7 +108,6 @@ cryptography==42.0.3
# via
# -r requirements/test.txt
# pyjwt
# secretstorage
# social-auth-core
ddt==1.7.1
# via -r requirements/test.txt
Expand All @@ -121,9 +124,9 @@ distlib==0.3.8
# via
# -r requirements/test.txt
# virtualenv
django==3.2.24
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/test.txt
# django-appconf
# django-config-models
Expand Down Expand Up @@ -331,10 +334,6 @@ itypes==1.2.0
# coreapi
jaraco-classes==3.3.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -539,7 +538,6 @@ pytz==2024.1
# via
# -r requirements/test.txt
# babel
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -589,8 +587,6 @@ s3transfer==0.10.0
# via
# -r requirements/test.txt
# boto3
secretstorage==3.3.3
# via keyring
semantic-version==2.10.0
# via
# -r requirements/test.txt
Expand Down
7 changes: 5 additions & 2 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ attrs==23.2.0
# -r requirements/base.txt
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
bleach==6.1.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -77,7 +81,7 @@ defusedxml==0.8.0rc2
# -r requirements/base.txt
# python3-openid
# social-auth-core
django==3.2.24
django==4.2.11
# via
# -r requirements/base.txt
# django-appconf
Expand Down Expand Up @@ -372,7 +376,6 @@ python3-openid==3.2.0
pytz==2024.1
# via
# -r requirements/base.txt
# django
# django-ses
# djangorestframework
# drf-yasg
Expand Down
16 changes: 6 additions & 10 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ attrs==23.2.0
# -r requirements/test.txt
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via
# -r requirements/test.txt
# django
bleach==6.1.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -98,7 +102,6 @@ cryptography==42.0.3
# via
# -r requirements/test.txt
# pyjwt
# secretstorage
# social-auth-core
ddt==1.7.1
# via -r requirements/test.txt
Expand All @@ -115,9 +118,9 @@ distlib==0.3.8
# via
# -r requirements/test.txt
# virtualenv
django==3.2.24
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/test.txt
# django-appconf
# django-config-models
Expand Down Expand Up @@ -316,10 +319,6 @@ itypes==1.2.0
# coreapi
jaraco-classes==3.3.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -520,7 +519,6 @@ python3-openid==3.2.0
pytz==2024.1
# via
# -r requirements/test.txt
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -567,8 +565,6 @@ s3transfer==0.10.0
# via
# -r requirements/test.txt
# boto3
secretstorage==3.3.3
# via keyring
semantic-version==2.10.0
# via
# -r requirements/test.txt
Expand Down
7 changes: 5 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ attrs==23.2.0
# -r requirements/base.txt
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
bleach==6.1.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -103,7 +107,7 @@ dill==0.3.8
distlib==0.3.8
# via virtualenv
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-appconf
# django-config-models
Expand Down Expand Up @@ -447,7 +451,6 @@ python3-openid==3.2.0
pytz==2024.1
# via
# -r requirements/base.txt
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down
18 changes: 6 additions & 12 deletions requirements/validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ attrs==23.2.0
# -r requirements/test.txt
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via
# -r requirements/quality.txt
# -r requirements/test.txt
# django
bleach==6.1.0
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -119,7 +124,6 @@ cryptography==42.0.3
# -r requirements/quality.txt
# -r requirements/test.txt
# pyjwt
# secretstorage
# social-auth-core
ddt==1.7.1
# via
Expand All @@ -141,7 +145,7 @@ distlib==0.3.8
# -r requirements/quality.txt
# -r requirements/test.txt
# virtualenv
django==3.2.24
django==4.2.11
# via
# -r requirements/quality.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -403,11 +407,6 @@ jaraco-classes==3.3.1
# via
# -r requirements/quality.txt
# keyring
jeepney==0.8.0
# via
# -r requirements/quality.txt
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -668,7 +667,6 @@ pytz==2024.1
# via
# -r requirements/quality.txt
# -r requirements/test.txt
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -730,10 +728,6 @@ s3transfer==0.10.0
# -r requirements/quality.txt
# -r requirements/test.txt
# boto3
secretstorage==3.3.3
# via
# -r requirements/quality.txt
# keyring
semantic-version==2.10.0
# via
# -r requirements/quality.txt
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,42}, quality, docs, pii_check
envlist = py38-django{42}, quality, docs, pii_check
skipsdist = true

[doc8]
Expand Down Expand Up @@ -43,7 +43,6 @@ filterwarnings =

[testenv]
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
commands =
Expand Down

0 comments on commit c5d0b6a

Please sign in to comment.