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 27064c30..5c5f42f1 100644 --- a/Makefile +++ b/Makefile @@ -98,8 +98,20 @@ 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): + wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)" + echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@) + upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade -upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in +upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in + sed 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp + mv requirements/common_constraints.tmp requirements/common_constraints.txt # Make sure to compile files after any other files they include! pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in diff --git a/edx_exams/settings/base.py b/edx_exams/settings/base.py index 2b5aae05..a8b5f40d 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/requirements/base.txt b/requirements/base.txt index f43abf2b..a1d410f3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -12,6 +12,8 @@ attrs==23.1.0 # via # lti-consumer-xblock # openedx-events +backports-zoneinfo==0.2.1 + # via django bleach==6.0.0 # via lti-consumer-xblock boto3==1.28.59 @@ -50,7 +52,6 @@ defusedxml==0.8.0rc2 # social-auth-core django==3.2.22 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in # django-appconf # django-config-models @@ -99,7 +100,7 @@ django-rest-swagger==2.2.0 # via -r requirements/base.in django-simple-history==3.0.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.in django-statici18n==2.4.0 # via lti-consumer-xblock @@ -266,7 +267,6 @@ python3-openid==3.2.0 pytz==2023.3.post1 # via # -r requirements/base.in - # django # djangorestframework # drf-yasg # xblock diff --git a/requirements/ci.txt b/requirements/ci.txt index f8691ab2..43dc4704 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -22,7 +22,7 @@ six==1.16.0 # via tox tox==3.28.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/ci.in virtualenv==20.24.5 # via tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..0091b9ec --- /dev/null +++ b/requirements/common_constraints.txt @@ -0,0 +1,32 @@ +# 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. +# +# Similar to other constraint files this file doesn't install any packages. +# It specifies version constraints that will be applied if a package is needed. +# When pinning something here, please provide an explanation of why it is a good +# idea to pin this package across all edx repos, Ideally, link to other information +# that will help people in the future to remove the pin when possible. +# Writing an issue against the offending project and linking to it here is good. +# +# Note: Changes to this file will automatically be used by other repos, referencing +# this file from Github directly. It does not require packaging in edx-lint. + + +# using LTS django version + + +# 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 +elasticsearch<7.14.0 + +# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected +django-simple-history==3.0.0 + +# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. +# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 +tox<4.0.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 2ebd6ea6..1adca710 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -8,7 +8,9 @@ # pin when possible. Writing an issue against the offending project and # linking to it here is good. -# Common constraints for edx repos --c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt +Django<4.3 + +# Common constraints for edx repos +-c common_constraints.txt diff --git a/requirements/dev.txt b/requirements/dev.txt index a298fb15..be77eb06 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -22,6 +22,10 @@ attrs==23.1.0 # -r requirements/validation.txt # lti-consumer-xblock # openedx-events +backports-zoneinfo==0.2.1 + # via + # -r requirements/validation.txt + # django bleach==6.0.0 # via # -r requirements/validation.txt @@ -536,7 +540,6 @@ python3-openid==3.2.0 pytz==2023.3.post1 # via # -r requirements/validation.txt - # django # djangorestframework # drf-yasg # xblock diff --git a/requirements/django.txt b/requirements/django.txt index 5a28da34..c7734200 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==3.2.22 +django==4.2.5 diff --git a/requirements/doc.txt b/requirements/doc.txt index 6ecc9aa0..ae033e01 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -26,6 +26,10 @@ attrs==23.1.0 # openedx-events babel==2.13.0 # via sphinx +backports-zoneinfo==0.2.1 + # via + # -r requirements/test.txt + # django bleach==6.0.0 # via # -r requirements/test.txt @@ -105,7 +109,6 @@ distlib==0.3.7 # virtualenv django==3.2.22 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt # django-appconf # django-config-models @@ -163,7 +166,7 @@ django-rest-swagger==2.2.0 # via -r requirements/test.txt django-simple-history==3.0.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.txt django-statici18n==2.4.0 # via @@ -639,7 +642,7 @@ tomlkit==0.12.1 # pylint tox==3.28.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.txt twine==4.0.2 # via -r requirements/doc.in diff --git a/requirements/production.txt b/requirements/production.txt index 01d3386a..e223af8e 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -17,6 +17,10 @@ attrs==23.1.0 # -r requirements/base.txt # lti-consumer-xblock # openedx-events +backports-zoneinfo==0.2.1 + # via + # -r requirements/base.txt + # django bleach==6.0.0 # via # -r requirements/base.txt @@ -362,7 +366,6 @@ python3-openid==3.2.0 pytz==2023.3.post1 # via # -r requirements/base.txt - # django # djangorestframework # drf-yasg # xblock diff --git a/requirements/quality.txt b/requirements/quality.txt index 7e97f787..948d0e9f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -22,6 +22,10 @@ attrs==23.1.0 # -r requirements/test.txt # lti-consumer-xblock # openedx-events +backports-zoneinfo==0.2.1 + # via + # -r requirements/test.txt + # django bleach==6.0.0 # via # -r requirements/test.txt @@ -99,7 +103,6 @@ distlib==0.3.7 # virtualenv django==3.2.22 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt # django-appconf # django-config-models @@ -157,7 +160,7 @@ django-rest-swagger==2.2.0 # via -r requirements/test.txt django-simple-history==3.0.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.txt django-statici18n==2.4.0 # via @@ -493,7 +496,6 @@ python3-openid==3.2.0 pytz==2023.3.post1 # via # -r requirements/test.txt - # django # djangorestframework # drf-yasg # xblock @@ -597,7 +599,7 @@ tomlkit==0.12.1 # pylint tox==3.28.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.txt twine==4.0.2 # via -r requirements/quality.in diff --git a/requirements/test.txt b/requirements/test.txt index 656bb4b9..8f3d8440 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -21,6 +21,10 @@ attrs==23.1.0 # -r requirements/base.txt # lti-consumer-xblock # openedx-events +backports-zoneinfo==0.2.1 + # via + # -r requirements/base.txt + # django bleach==6.0.0 # via # -r requirements/base.txt @@ -92,7 +96,6 @@ dill==0.3.7 distlib==0.3.7 # via virtualenv # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.txt # django-appconf # django-config-models @@ -150,7 +153,7 @@ django-rest-swagger==2.2.0 # via -r requirements/base.txt django-simple-history==3.0.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.txt django-statici18n==2.4.0 # via @@ -433,7 +436,6 @@ python3-openid==3.2.0 pytz==2023.3.post1 # via # -r requirements/base.txt - # django # djangorestframework # drf-yasg # xblock @@ -523,7 +525,7 @@ tomlkit==0.12.1 # via pylint tox==3.28.0 # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/test.in types-pyyaml==6.0.12.12 # via responses diff --git a/requirements/validation.txt b/requirements/validation.txt index 728d0a35..e6fb22ac 100644 --- a/requirements/validation.txt +++ b/requirements/validation.txt @@ -26,6 +26,11 @@ attrs==23.1.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.0.0 # via # -r requirements/quality.txt @@ -632,7 +637,6 @@ pytz==2023.3.post1 # via # -r requirements/quality.txt # -r requirements/test.txt - # django # djangorestframework # drf-yasg # xblock diff --git a/tox.ini b/tox.ini index f79a6c3a..4c3003ee 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 =