diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32ca4d49..f30f5821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Makefile b/Makefile index 6b17a108..9d284501 100644 --- a/Makefile +++ b/Makefile @@ -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): diff --git a/edx_exams/settings/base.py b/edx_exams/settings/base.py index 34f1a33b..dcb23443 100644 --- a/edx_exams/settings/base.py +++ b/edx_exams/settings/base.py @@ -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'), ) diff --git a/edx_exams/settings/production.py b/edx_exams/settings/production.py index ffd7e261..4334165a 100644 --- a/edx_exams/settings/production.py +++ b/edx_exams/settings/production.py @@ -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 diff --git a/requirements/base.txt b/requirements/base.txt index a19f5568..37b1563e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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 @@ -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 @@ -270,7 +272,6 @@ python3-openid==3.2.0 pytz==2024.1 # via # -r requirements/base.in - # django # djangorestframework # drf-yasg # xblock diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index d26d7918..1f68538a 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -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. @@ -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 diff --git a/requirements/dev.txt b/requirements/dev.txt index f9c6c343..624c59ad 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -569,7 +567,6 @@ python3-openid==3.2.0 pytz==2024.1 # via # -r requirements/validation.txt - # django # djangorestframework # drf-yasg # xblock @@ -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 diff --git a/requirements/django.txt b/requirements/django.txt index 7eec28f9..db03776f 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==3.2.24 +django==4.2.11 diff --git a/requirements/doc.txt b/requirements/doc.txt index da80b891..ca9a9c3b 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -539,7 +538,6 @@ pytz==2024.1 # via # -r requirements/test.txt # babel - # django # djangorestframework # drf-yasg # xblock @@ -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 diff --git a/requirements/production.txt b/requirements/production.txt index 49599758..4bfb5d40 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -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 @@ -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 @@ -372,7 +376,6 @@ python3-openid==3.2.0 pytz==2024.1 # via # -r requirements/base.txt - # django # django-ses # djangorestframework # drf-yasg diff --git a/requirements/quality.txt b/requirements/quality.txt index 040a6312..fa2ff26f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -520,7 +519,6 @@ python3-openid==3.2.0 pytz==2024.1 # via # -r requirements/test.txt - # django # djangorestframework # drf-yasg # xblock @@ -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 diff --git a/requirements/test.txt b/requirements/test.txt index 01321df6..4b2293ee 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -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 @@ -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 @@ -447,7 +451,6 @@ python3-openid==3.2.0 pytz==2024.1 # via # -r requirements/base.txt - # django # djangorestframework # drf-yasg # xblock diff --git a/requirements/validation.txt b/requirements/validation.txt index e1b03da6..e8aeacd1 100644 --- a/requirements/validation.txt +++ b/requirements/validation.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -668,7 +667,6 @@ pytz==2024.1 # via # -r requirements/quality.txt # -r requirements/test.txt - # django # djangorestframework # drf-yasg # xblock @@ -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 diff --git a/tox.ini b/tox.ini index 1d0e6eb4..2be151a7 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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 =