From 0b26805c62a0739efd3b9e67b122f6532fb53eb0 Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Thu, 28 Sep 2023 14:52:05 +0500 Subject: [PATCH] feat!: Upgrade to Django 4.2 --- .github/workflows/ci.yml | 4 ++-- Makefile | 2 +- requirements/base.txt | 9 ++++----- requirements/common_constraints.txt | 4 ++-- requirements/constraints.txt | 3 ++- requirements/devstack.txt | 22 +++++++++++++-------- requirements/django.txt | 2 +- requirements/local.txt | 20 +++++++++++-------- requirements/monitoring/requirements.txt | 25 +++++++++++++++++------- requirements/production.txt | 18 +++++++++-------- requirements/test.txt | 13 ++++++------ tox.ini | 5 ++--- 12 files changed, 75 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 093b6746..c79e002f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - ubuntu-20.04 python-version: - 3.8 - toxenv: [ django32, django42 ] + toxenv: [ django42 ] steps: - uses: actions/checkout@v1 - name: setup python @@ -46,7 +46,7 @@ jobs: make static make validate_translations - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django32' + if: matrix.python-version == '3.8' && matrix.toxenv=='django42' uses: codecov/codecov-action@v1 with: flags: unittests diff --git a/Makefile b/Makefile index 2e93f5b3..c6ff3b6a 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ $(COMMON_CONSTRAINTS_TXT): upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## re-compile requirements .txt files from .in files - sed 's/django-simple-history==3.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp + sed 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp mv requirements/common_constraints.tmp requirements/common_constraints.txt pip-compile --allow-unsafe --rebuild --upgrade -o requirements/pip.txt requirements/pip.in pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in diff --git a/requirements/base.txt b/requirements/base.txt index eb269731..ace0be4c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -14,6 +14,8 @@ async-timeout==4.0.3 # via redis backoff==1.10.0 # via analytics-python +backports-zoneinfo==0.2.1 + # via django billiard==3.6.4.0 # via celery celery==4.4.7 @@ -39,9 +41,8 @@ defusedxml==0.8.0rc2 # via # python3-openid # social-auth-core -django==3.2.22 +django==4.2.6 # via - # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.in # django-cors-headers @@ -78,8 +79,7 @@ django-model-utils==4.3.1 # django-user-tasks django-mysql==4.11.0 # via -r requirements/base.in -django-simple-history==3.4.0 - # via -r requirements/base.in +django-simple-history==3.0.0 # via # -c requirements/common_constraints.txt # -r requirements/base.in @@ -167,7 +167,6 @@ pytz==2023.3.post1 # via # -r requirements/base.in # celery - # django # djangorestframework # drf-yasg pyyaml==6.0.1 diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 18ff1b20..0091b9ec 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -18,14 +18,14 @@ # 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 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 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 83e08183..eca21e89 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,7 +11,8 @@ # Common constraints for edx repos -c common_constraints.txt -Django<4.0 +# This constraint can be removed once global constraint is updated. +Django<4.3 # Version 3.2.0 contains bad arabic translations that will cause validation tests to fail django-extensions<3.2.0 diff --git a/requirements/devstack.txt b/requirements/devstack.txt index 0eaf9b6f..5e4a62b8 100644 --- a/requirements/devstack.txt +++ b/requirements/devstack.txt @@ -40,6 +40,10 @@ backoff==1.10.0 # via # -r requirements/local.txt # analytics-python +backports-zoneinfo==0.2.1 + # via + # -r requirements/local.txt + # django beautifulsoup4==4.12.2 # via # -r requirements/local.txt @@ -48,12 +52,12 @@ billiard==3.6.4.0 # via # -r requirements/local.txt # celery -boto3==1.28.60 +boto3==1.28.62 # via # -c requirements/constraints.txt # -r requirements/local.txt # moto -botocore==1.31.60 +botocore==1.31.62 # via # -r requirements/local.txt # boto3 @@ -122,9 +126,8 @@ distlib==0.3.7 # via # -r requirements/local.txt # virtualenv -django==3.2.22 +django==4.2.6 # via - # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/local.txt # django-cors-headers @@ -169,8 +172,8 @@ django-model-utils==4.3.1 # django-user-tasks django-mysql==4.11.0 # via -r requirements/local.txt -django-simple-history==3.4.0 - # via -r requirements/local.txt +django-simple-history==3.0.0 + # via # -c requirements/common_constraints.txt # -r requirements/local.txt django-storages==1.10.1 @@ -219,7 +222,7 @@ edx-django-utils==5.7.0 # edx-rest-api-client edx-drf-extensions==8.10.0 # via -r requirements/local.txt -edx-i18n-tools==1.2.0 +edx-i18n-tools==1.3.0 # via -r requirements/local.txt edx-lint==5.3.4 # via -r requirements/local.txt @@ -289,6 +292,10 @@ lazy-object-proxy==1.9.0 # via # -r requirements/local.txt # astroid +lxml==4.9.3 + # via + # -r requirements/local.txt + # edx-i18n-tools lz4==4.3.2 # via # -r requirements/local.txt @@ -450,7 +457,6 @@ pytz==2023.3.post1 # -r requirements/local.txt # babel # celery - # django # djangorestframework # drf-yasg pywatchman==1.4.1 diff --git a/requirements/django.txt b/requirements/django.txt index 5a28da34..7ac6d4fc 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==3.2.22 +django==4.2.6 diff --git a/requirements/local.txt b/requirements/local.txt index 8d86360f..6bf726f4 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -40,6 +40,10 @@ backoff==1.10.0 # via # -r requirements/test.txt # analytics-python +backports-zoneinfo==0.2.1 + # via + # -r requirements/test.txt + # django beautifulsoup4==4.12.2 # via # -r requirements/docs.txt @@ -48,12 +52,12 @@ billiard==3.6.4.0 # via # -r requirements/test.txt # celery -boto3==1.28.60 +boto3==1.28.62 # via # -c requirements/constraints.txt # -r requirements/test.txt # moto -botocore==1.31.60 +botocore==1.31.62 # via # -r requirements/test.txt # boto3 @@ -122,9 +126,8 @@ distlib==0.3.7 # via # -r requirements/test.txt # virtualenv -django==3.2.22 +django==4.2.6 # via - # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/test.txt # django-cors-headers @@ -169,8 +172,8 @@ django-model-utils==4.3.1 # django-user-tasks django-mysql==4.11.0 # via -r requirements/test.txt -django-simple-history==3.4.0 - # via -r requirements/test.txt +django-simple-history==3.0.0 + # via # -c requirements/common_constraints.txt # -r requirements/test.txt django-storages==1.10.1 @@ -219,7 +222,7 @@ edx-django-utils==5.7.0 # edx-rest-api-client edx-drf-extensions==8.10.0 # via -r requirements/test.txt -edx-i18n-tools==1.2.0 +edx-i18n-tools==1.3.0 # via -r requirements/local.in edx-lint==5.3.4 # via -r requirements/test.txt @@ -291,6 +294,8 @@ lazy-object-proxy==1.9.0 # via # -r requirements/test.txt # astroid +lxml==4.9.3 + # via edx-i18n-tools lz4==4.3.2 # via ruamel-yaml-cmd markupsafe==2.1.3 @@ -443,7 +448,6 @@ pytz==2023.3.post1 # -r requirements/test.txt # babel # celery - # django # djangorestframework # drf-yasg pywatchman==1.4.1 diff --git a/requirements/monitoring/requirements.txt b/requirements/monitoring/requirements.txt index 146ae1c8..fa57c01e 100644 --- a/requirements/monitoring/requirements.txt +++ b/requirements/monitoring/requirements.txt @@ -61,6 +61,13 @@ backoff==1.10.0 # -r requirements/monitoring/../production.txt # -r requirements/monitoring/../test.txt # analytics-python +backports-zoneinfo==0.2.1 + # via + # -r requirements/monitoring/../devstack.txt + # -r requirements/monitoring/../local.txt + # -r requirements/monitoring/../production.txt + # -r requirements/monitoring/../test.txt + # django beautifulsoup4==4.12.2 # via # -r requirements/monitoring/../devstack.txt @@ -73,14 +80,14 @@ billiard==3.6.4.0 # -r requirements/monitoring/../production.txt # -r requirements/monitoring/../test.txt # celery -boto3==1.28.60 +boto3==1.28.62 # via # -r requirements/monitoring/../devstack.txt # -r requirements/monitoring/../local.txt # -r requirements/monitoring/../production.txt # -r requirements/monitoring/../test.txt # moto -botocore==1.31.60 +botocore==1.31.62 # via # -r requirements/monitoring/../devstack.txt # -r requirements/monitoring/../local.txt @@ -185,7 +192,7 @@ distlib==0.3.7 # -r requirements/monitoring/../local.txt # -r requirements/monitoring/../test.txt # virtualenv -django==3.2.22 +django==4.2.6 # via # -r requirements/monitoring/../devstack.txt # -r requirements/monitoring/../local.txt @@ -258,7 +265,7 @@ django-mysql==4.11.0 # -r requirements/monitoring/../local.txt # -r requirements/monitoring/../production.txt # -r requirements/monitoring/../test.txt -django-simple-history==3.4.0 +django-simple-history==3.0.0 # via # -r requirements/monitoring/../devstack.txt # -r requirements/monitoring/../local.txt @@ -348,7 +355,7 @@ edx-drf-extensions==8.10.0 # -r requirements/monitoring/../local.txt # -r requirements/monitoring/../production.txt # -r requirements/monitoring/../test.txt -edx-i18n-tools==1.2.0 +edx-i18n-tools==1.3.0 # via # -r requirements/monitoring/../devstack.txt # -r requirements/monitoring/../local.txt @@ -472,6 +479,11 @@ lazy-object-proxy==1.9.0 # -r requirements/monitoring/../local.txt # -r requirements/monitoring/../test.txt # astroid +lxml==4.9.3 + # via + # -r requirements/monitoring/../devstack.txt + # -r requirements/monitoring/../local.txt + # edx-i18n-tools lz4==4.3.2 # via # -r requirements/monitoring/../devstack.txt @@ -719,7 +731,6 @@ pytz==2023.3.post1 # -r requirements/monitoring/../test.txt # babel # celery - # django # djangorestframework # drf-yasg pywatchman==1.4.1 @@ -1015,7 +1026,7 @@ zope-event==5.0 # via # -r requirements/monitoring/../production.txt # gevent -zope-interface==6.0 +zope-interface==6.1 # via # -r requirements/monitoring/../production.txt # gevent diff --git a/requirements/production.txt b/requirements/production.txt index e0622653..33d32037 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -22,15 +22,19 @@ backoff==1.10.0 # via # -r requirements/base.txt # analytics-python +backports-zoneinfo==0.2.1 + # via + # -r requirements/base.txt + # django billiard==3.6.4.0 # via # -r requirements/base.txt # celery -boto3==1.28.60 +boto3==1.28.62 # via # -c requirements/constraints.txt # -r requirements/production.in -botocore==1.31.60 +botocore==1.31.62 # via # boto3 # s3transfer @@ -66,9 +70,8 @@ defusedxml==0.8.0rc2 # -r requirements/base.txt # python3-openid # social-auth-core -django==3.2.22 +django==4.2.6 # via - # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.txt # django-cors-headers @@ -107,8 +110,8 @@ django-model-utils==4.3.1 # django-user-tasks django-mysql==4.11.0 # via -r requirements/base.txt -django-simple-history==3.4.0 - # via -r requirements/base.txt +django-simple-history==3.0.0 + # via # -c requirements/common_constraints.txt # -r requirements/base.txt django-storages==1.10.1 @@ -248,7 +251,6 @@ pytz==2023.3.post1 # via # -r requirements/base.txt # celery - # django # djangorestframework # drf-yasg pyyaml==6.0.1 @@ -331,7 +333,7 @@ vine==1.3.0 # celery zope-event==5.0 # via gevent -zope-interface==6.0 +zope-interface==6.1 # via gevent # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index 0fb030da..1958a5b4 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -26,15 +26,19 @@ backoff==1.10.0 # via # -r requirements/base.txt # analytics-python +backports-zoneinfo==0.2.1 + # via + # -r requirements/base.txt + # django billiard==3.6.4.0 # via # -r requirements/base.txt # celery -boto3==1.28.60 +boto3==1.28.62 # via # -c requirements/constraints.txt # moto -botocore==1.31.60 +botocore==1.31.62 # via # boto3 # moto @@ -93,7 +97,6 @@ dill==0.3.7 distlib==0.3.7 # via virtualenv # via - # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.txt # django-cors-headers @@ -134,8 +137,7 @@ django-model-utils==4.3.1 # django-user-tasks django-mysql==4.11.0 # via -r requirements/base.txt -django-simple-history==3.4.0 - # via -r requirements/base.txt +django-simple-history==3.0.0 # via # -c requirements/common_constraints.txt # -r requirements/base.txt @@ -343,7 +345,6 @@ pytz==2023.3.post1 # via # -r requirements/base.txt # celery - # django # djangorestframework # drf-yasg pyyaml==6.0.1 diff --git a/tox.ini b/tox.ini index 8ac4bf1c..9f8c397e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -envlist = py38-django{32, 42} +envlist = py38-django{42} skipsdist = true [testenv] passenv = * deps = - django32: -r requirements/django.txt - django42: Django>=4.2,<4.3 + django42: -r requirements/django.txt -r{toxinidir}/requirements/test.txt whitelist_externals = i18n_tool