From efe46e81a1abf2780c9dd6c3e1f39c4497c317e6 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 17 Oct 2023 16:43:58 +0500 Subject: [PATCH] Revert "Upgrade Django to 4.2 LTS" --- .github/docker-compose-ci.yml | 2 +- .github/workflows/ci.yml | 9 ++- Makefile | 2 +- requirements.txt | 57 ++++++++-------- requirements/base.in | 2 +- requirements/ci.txt | 14 ++-- requirements/common_constraints.txt | 7 +- requirements/dev.txt | 102 ++++++++++++---------------- requirements/pip-tools.txt | 19 ++---- requirements/pip.txt | 6 +- requirements/quality.txt | 2 +- requirements/test.txt | 79 ++++++++++----------- tox.ini | 3 +- xqueue/settings.py | 7 +- 14 files changed, 144 insertions(+), 167 deletions(-) diff --git a/.github/docker-compose-ci.yml b/.github/docker-compose-ci.yml index eee3f2eb..3427aa10 100644 --- a/.github/docker-compose-ci.yml +++ b/.github/docker-compose-ci.yml @@ -19,7 +19,7 @@ services: xqueue: container_name: xqueue - image: edxops/xqueue-dev:latest + image: edxops/xqueue:latest command: tail -f /dev/null volumes: - ..:/edx/app/xqueue/xqueue diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd9504f3..491aa9c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,14 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - tox-env: [quality, django42] + tox-env: [quality, django32, django42] python-version: [3.8] - db-version: ['mysql80'] + db-version: ['mysql57', 'mysql80'] + # excluding mysql5.7 with Django 4.2 since Django 4.2 has + # dropped support for MySQL<8 + exclude: + - tox-env: 'django42' + db-version: 'mysql57' steps: - uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index 26a1404f..7e514aff 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ $(COMMON_CONSTRAINTS_TXT): export CUSTOM_COMPILE_COMMAND = make upgrade upgrade: $(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 + sed 's/Django<2.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp mv requirements/common_constraints.tmp requirements/common_constraints.txt pip install -qr requirements/pip-tools.txt # Make sure to compile files after any other files they include! diff --git a/requirements.txt b/requirements.txt index 1be0c527..3da71718 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,44 +4,43 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.6.0 # via django backoff==2.2.1 # via -r requirements/base.in -backports-zoneinfo==0.2.1 - # via django -boto3==1.28.54 +boto3==1.26.91 # via -r requirements/base.in -botocore==1.31.54 +botocore==1.29.91 # via # boto3 # s3transfer -certifi==2023.7.22 +certifi==2022.12.7 # via requests cffi==1.15.1 # via pynacl -charset-normalizer==3.2.0 +charset-normalizer==3.1.0 # via requests -click==8.1.7 +click==8.1.3 # via edx-django-utils -django==4.2.5 +django==3.2.20 # via + # -c requirements/common_constraints.txt + # -r requirements/base.in # django-crum # django-storages - # django-waffle # edx-django-release-util # edx-django-utils django-crum==0.7.9 # via edx-django-utils -django-storages==1.14 +django-storages==1.13.2 # via -r requirements/base.in -django-waffle==4.0.0 +django-waffle==3.0.0 # via edx-django-utils -edx-django-release-util==1.3.0 +edx-django-release-util==1.2.0 # via -r requirements/base.in -edx-django-utils==5.7.0 +edx-django-utils==5.2.0 # via -r requirements/base.in -gunicorn==21.2.0 +gunicorn==20.1.0 # via -r requirements/base.in idna==3.4 # via requests @@ -51,19 +50,17 @@ jmespath==1.0.1 # via # boto3 # botocore -mysqlclient==2.2.0 +mysqlclient==2.1.1 # via -r requirements/base.in -newrelic==9.1.0 +newrelic==8.7.0 # via # -r requirements/base.in # edx-django-utils -packaging==23.1 - # via gunicorn path-py==11.0.1 # via -r requirements/base.in pbr==5.11.1 # via stevedore -psutil==5.9.5 +psutil==5.9.4 # via edx-django-utils pycparser==2.21 # via cffi @@ -75,26 +72,26 @@ python-memcached==1.59 # via -r requirements/base.in python-termstyle==0.1.10 # via -r requirements/base.in -pytz==2023.3.post1 - # via -r requirements/base.in -pyyaml==6.0.1 +pytz==2022.7.1 + # via + # -r requirements/base.in + # django +pyyaml==6.0 # via edx-django-release-util -requests==2.31.0 +requests==2.28.2 # via -r requirements/base.in -s3transfer==0.6.2 +s3transfer==0.6.0 # via boto3 six==1.16.0 # via # edx-django-release-util # python-dateutil # python-memcached -sqlparse==0.4.4 +sqlparse==0.4.3 # via django -stevedore==5.1.0 +stevedore==5.0.0 # via edx-django-utils -typing-extensions==4.8.0 - # via asgiref -urllib3==1.26.16 +urllib3==1.26.15 # via # botocore # requests diff --git a/requirements/base.in b/requirements/base.in index 6e21f416..9063526b 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -4,7 +4,7 @@ mysqlclient backoff boto3 -Django +Django<4 django-storages edx-django-release-util edx-django-utils diff --git a/requirements/ci.txt b/requirements/ci.txt index 09f92b40..a3483c39 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -4,17 +4,17 @@ # # make upgrade # -distlib==0.3.7 +distlib==0.3.6 # via virtualenv -filelock==3.12.4 +filelock==3.9.1 # via # tox # virtualenv -packaging==23.1 +packaging==23.0 # via tox -platformdirs==3.10.0 +platformdirs==3.1.1 # via virtualenv -pluggy==1.3.0 +pluggy==1.0.0 # via tox py==1.11.0 # via tox @@ -27,7 +27,7 @@ tox==3.28.0 # -c requirements/common_constraints.txt # -r requirements/ci.in # tox-battery -tox-battery==0.6.2 +tox-battery==0.6.1 # via -r requirements/ci.in -virtualenv==20.24.5 +virtualenv==20.21.0 # via tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 0091b9ec..a9878ac2 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -18,7 +18,7 @@ # using LTS django version - +Django<4.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 @@ -30,3 +30,8 @@ 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 + +# edx-sphinx-theme is not compatible with latest Sphinx==6.0.0 version +# Pinning Sphinx version unless the compatibility issue gets resolved +# For details, see issue https://github.com/openedx/edx-sphinx-theme/issues/197 +sphinx<6.0.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index 22bb6dfb..f752de68 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,28 +4,28 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.6.0 # via # -r requirements/test.txt # django -backoff==2.2.1 - # via -r requirements/test.txt -backports-zoneinfo==0.2.1 +attrs==22.2.0 # via # -r requirements/test.txt - # django -boto3==1.28.54 + # pytest +backoff==2.2.1 # via -r requirements/test.txt -botocore==1.31.54 +boto3==1.26.91 + # via -r requirements/test.txt +botocore==1.29.91 # via # -r requirements/test.txt # boto3 # s3transfer -build==1.0.3 +build==0.10.0 # via # -r requirements/pip-tools.txt # pip-tools -certifi==2023.7.22 +certifi==2022.12.7 # via # -r requirements/test.txt # requests @@ -33,65 +33,61 @@ cffi==1.15.1 # via # -r requirements/test.txt # pynacl -charset-normalizer==3.2.0 +charset-normalizer==3.1.0 # via # -r requirements/test.txt # requests -click==8.1.7 +click==8.1.3 # via # -r requirements/pip-tools.txt # -r requirements/test.txt # edx-django-utils # pip-tools -coverage[toml]==7.3.1 +coverage[toml]==7.2.1 # via # -r requirements/test.txt # pytest-cov -distlib==0.3.7 +distlib==0.3.6 # via # -r requirements/ci.txt # virtualenv -django==4.2.5 +django==3.2.20 # via + # -c requirements/common_constraints.txt # -r requirements/test.txt # django-crum # django-storages - # django-waffle # edx-django-release-util # edx-django-utils django-crum==0.7.9 # via # -r requirements/test.txt # edx-django-utils -django-storages==1.14 +django-storages==1.13.2 # via -r requirements/test.txt -django-waffle==4.0.0 +django-waffle==3.0.0 # via # -r requirements/test.txt # edx-django-utils -edx-django-release-util==1.3.0 +edx-django-release-util==1.2.0 # via -r requirements/test.txt -edx-django-utils==5.7.0 +edx-django-utils==5.2.0 # via -r requirements/test.txt -exceptiongroup==1.1.3 +exceptiongroup==1.1.1 # via # -r requirements/test.txt # pytest -filelock==3.12.4 +filelock==3.9.1 # via # -r requirements/ci.txt # tox # virtualenv -gunicorn==21.2.0 +gunicorn==20.1.0 # via -r requirements/test.txt idna==3.4 # via # -r requirements/test.txt # requests -importlib-metadata==6.8.0 - # via - # -r requirements/pip-tools.txt - # build iniconfig==2.0.0 # via # -r requirements/test.txt @@ -103,19 +99,18 @@ jmespath==1.0.1 # -r requirements/test.txt # boto3 # botocore -mysqlclient==2.2.0 +mysqlclient==2.1.1 # via -r requirements/test.txt -newrelic==9.1.0 +newrelic==8.7.0 # via # -r requirements/test.txt # edx-django-utils -packaging==23.1 +packaging==23.0 # via # -r requirements/ci.txt # -r requirements/pip-tools.txt # -r requirements/test.txt # build - # gunicorn # pytest # tox path-py==11.0.1 @@ -124,19 +119,19 @@ pbr==5.11.1 # via # -r requirements/test.txt # stevedore -pip-tools==7.3.0 +pip-tools==6.12.3 # via -r requirements/pip-tools.txt -platformdirs==3.10.0 +platformdirs==3.1.1 # via # -r requirements/ci.txt # virtualenv -pluggy==1.3.0 +pluggy==1.0.0 # via # -r requirements/ci.txt # -r requirements/test.txt # pytest # tox -psutil==5.9.5 +psutil==5.9.4 # via # -r requirements/test.txt # edx-django-utils @@ -144,7 +139,7 @@ py==1.11.0 # via # -r requirements/ci.txt # tox -pycodestyle==2.11.0 +pycodestyle==2.10.0 # via -r requirements/quality.txt pycparser==2.21 # via @@ -158,12 +153,12 @@ pyproject-hooks==1.0.0 # via # -r requirements/pip-tools.txt # build -pytest==7.4.2 +pytest==7.2.2 # via # -r requirements/test.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==4.0.0 # via -r requirements/test.txt pytest-django==4.5.2 # via -r requirements/test.txt @@ -175,17 +170,19 @@ python-memcached==1.59 # via -r requirements/test.txt python-termstyle==0.1.10 # via -r requirements/test.txt -pytz==2023.3.post1 - # via -r requirements/test.txt +pytz==2022.7.1 + # via + # -r requirements/test.txt + # django pywatchman==1.4.1 ; "linux" in sys_platform # via -r requirements/dev.in -pyyaml==6.0.1 +pyyaml==6.0 # via # -r requirements/test.txt # edx-django-release-util -requests==2.31.0 +requests==2.28.2 # via -r requirements/test.txt -s3transfer==0.6.2 +s3transfer==0.6.0 # via # -r requirements/test.txt # boto3 @@ -197,11 +194,11 @@ six==1.16.0 # python-dateutil # python-memcached # tox -sqlparse==0.4.4 +sqlparse==0.4.3 # via # -r requirements/test.txt # django -stevedore==5.1.0 +stevedore==5.0.0 # via # -r requirements/test.txt # edx-django-utils @@ -212,7 +209,6 @@ tomli==2.0.1 # -r requirements/test.txt # build # coverage - # pip-tools # pyproject-hooks # pytest # tox @@ -221,29 +217,21 @@ tox==3.28.0 # -c requirements/common_constraints.txt # -r requirements/ci.txt # tox-battery -tox-battery==0.6.2 +tox-battery==0.6.1 # via -r requirements/ci.txt -typing-extensions==4.8.0 - # via - # -r requirements/test.txt - # asgiref -urllib3==1.26.16 +urllib3==1.26.15 # via # -r requirements/test.txt # botocore # requests -virtualenv==20.24.5 +virtualenv==20.21.0 # via # -r requirements/ci.txt # tox -wheel==0.41.2 +wheel==0.40.0 # via # -r requirements/pip-tools.txt # pip-tools -zipp==3.17.0 - # via - # -r requirements/pip-tools.txt - # importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 894fa179..baf1aa51 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,27 +4,20 @@ # # make upgrade # -build==1.0.3 +build==0.10.0 # via pip-tools -click==8.1.7 +click==8.1.3 # via pip-tools -importlib-metadata==6.8.0 +packaging==23.0 # via build -packaging==23.1 - # via build -pip-tools==7.3.0 +pip-tools==6.12.3 # via -r requirements/pip-tools.in pyproject-hooks==1.0.0 # via build tomli==2.0.1 - # via - # build - # pip-tools - # pyproject-hooks -wheel==0.41.2 + # via build +wheel==0.40.0 # via pip-tools -zipp==3.17.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 3e7d8f4a..45fb600b 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -4,11 +4,11 @@ # # make upgrade # -wheel==0.41.2 +wheel==0.40.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==23.2.1 +pip==23.0.1 # via -r requirements/pip.in -setuptools==68.2.2 +setuptools==67.6.0 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index bf5fddcd..cd9082f5 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -4,5 +4,5 @@ # # make upgrade # -pycodestyle==2.11.0 +pycodestyle==2.10.0 # via -r requirements/quality.in diff --git a/requirements/test.txt b/requirements/test.txt index df9448ae..46655cd5 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,24 +4,22 @@ # # make upgrade # -asgiref==3.7.2 +asgiref==3.6.0 # via # -r requirements/../requirements.txt # django +attrs==22.2.0 + # via pytest backoff==2.2.1 # via -r requirements/../requirements.txt -backports-zoneinfo==0.2.1 - # via - # -r requirements/../requirements.txt - # django -boto3==1.28.54 +boto3==1.26.91 # via -r requirements/../requirements.txt -botocore==1.31.54 +botocore==1.29.91 # via # -r requirements/../requirements.txt # boto3 # s3transfer -certifi==2023.7.22 +certifi==2022.12.7 # via # -r requirements/../requirements.txt # requests @@ -29,40 +27,40 @@ cffi==1.15.1 # via # -r requirements/../requirements.txt # pynacl -charset-normalizer==3.2.0 +charset-normalizer==3.1.0 # via # -r requirements/../requirements.txt # requests -click==8.1.7 +click==8.1.3 # via # -r requirements/../requirements.txt # edx-django-utils -coverage[toml]==7.3.1 +coverage[toml]==7.2.1 # via pytest-cov # via + # -c requirements/common_constraints.txt # -r requirements/../requirements.txt # django-crum # django-storages - # django-waffle # edx-django-release-util # edx-django-utils django-crum==0.7.9 # via # -r requirements/../requirements.txt # edx-django-utils -django-storages==1.14 +django-storages==1.13.2 # via -r requirements/../requirements.txt -django-waffle==4.0.0 +django-waffle==3.0.0 # via # -r requirements/../requirements.txt # edx-django-utils -edx-django-release-util==1.3.0 +edx-django-release-util==1.2.0 # via -r requirements/../requirements.txt -edx-django-utils==5.7.0 +edx-django-utils==5.2.0 # via -r requirements/../requirements.txt -exceptiongroup==1.1.3 +exceptiongroup==1.1.1 # via pytest -gunicorn==21.2.0 +gunicorn==20.1.0 # via -r requirements/../requirements.txt idna==3.4 # via @@ -77,26 +75,23 @@ jmespath==1.0.1 # -r requirements/../requirements.txt # boto3 # botocore -mysqlclient==2.2.0 +mysqlclient==2.1.1 # via -r requirements/../requirements.txt -newrelic==9.1.0 +newrelic==8.7.0 # via # -r requirements/../requirements.txt # edx-django-utils -packaging==23.1 - # via - # -r requirements/../requirements.txt - # gunicorn - # pytest +packaging==23.0 + # via pytest path-py==11.0.1 # via -r requirements/../requirements.txt pbr==5.11.1 # via # -r requirements/../requirements.txt # stevedore -pluggy==1.3.0 +pluggy==1.0.0 # via pytest -psutil==5.9.5 +psutil==5.9.4 # via # -r requirements/../requirements.txt # edx-django-utils @@ -108,12 +103,12 @@ pynacl==1.5.0 # via # -r requirements/../requirements.txt # edx-django-utils -pytest==7.4.2 +pytest==7.2.2 # via # -r requirements/test.in # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==4.0.0 # via -r requirements/test.in pytest-django==4.5.2 # via -r requirements/test.in @@ -125,15 +120,17 @@ python-memcached==1.59 # via -r requirements/../requirements.txt python-termstyle==0.1.10 # via -r requirements/../requirements.txt -pytz==2023.3.post1 - # via -r requirements/../requirements.txt -pyyaml==6.0.1 +pytz==2022.7.1 + # via + # -r requirements/../requirements.txt + # django +pyyaml==6.0 # via # -r requirements/../requirements.txt # edx-django-release-util -requests==2.31.0 +requests==2.28.2 # via -r requirements/../requirements.txt -s3transfer==0.6.2 +s3transfer==0.6.0 # via # -r requirements/../requirements.txt # boto3 @@ -143,23 +140,17 @@ six==1.16.0 # edx-django-release-util # python-dateutil # python-memcached -sqlparse==0.4.4 +sqlparse==0.4.3 # via # -r requirements/../requirements.txt # django -stevedore==5.1.0 +stevedore==5.0.0 # via # -r requirements/../requirements.txt # edx-django-utils tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.8.0 - # via - # -r requirements/../requirements.txt - # asgiref -urllib3==1.26.16 + # via pytest +urllib3==1.26.15 # via # -r requirements/../requirements.txt # botocore diff --git a/tox.ini b/tox.ini index 83bc7f23..7ad98a2a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{42},quality +envlist = py38-django{32, 42},quality skipsdist = True [pycodestyle] @@ -13,6 +13,7 @@ norecursedirs = .* jenkins load_tests log reports script test_framework xqueue [testenv] deps = + django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt passenv = diff --git a/xqueue/settings.py b/xqueue/settings.py index 384ba791..d10b7896 100644 --- a/xqueue/settings.py +++ b/xqueue/settings.py @@ -78,11 +78,6 @@ # If you set this to False, Django will not use timezone-aware datetimes. 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 - # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = '' @@ -95,6 +90,8 @@ # Make this unique, and don't share it with anybody. SECRET_KEY = 'uofqkujp@z#_vtwct+v716z+^3hijelj1^fkydwo2^pbkxghfq' +DEFAULT_HASHING_ALGORITHM = "sha1" + DEFAULT_AUTO_FIELD = "django.db.models.AutoField" MIDDLEWARE = (