Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
feat!: Upgrade to Django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram authored and UsamaSadiq committed Oct 9, 2023
1 parent 9b51243 commit 8115d8b
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- ubuntu-20.04
python-version:
- 3.8
toxenv: [ django32 ]
toxenv: [ django42 ]
steps:
- uses: actions/checkout@v1
- name: setup python
Expand All @@ -45,7 +45,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
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ 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
mv requirements/common_constraints.tmp requirements/common_constraints.txt
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
pip install -qr requirements/pip.txt
Expand Down
3 changes: 3 additions & 0 deletions registrar/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,6 @@

# disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False

# Keep using deprecated pytz for Django>4
USE_DEPRECATED_PYTZ = True
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -164,7 +165,6 @@ pytz==2023.3.post1
# via
# -r requirements/base.in
# celery
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions requirements/devstack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -452,7 +455,6 @@ pytz==2023.3.post1
# -r requirements/local.txt
# babel
# celery
# django
# djangorestframework
# drf-yasg
pywatchman==1.4.1
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.22
django==4.2.6
8 changes: 5 additions & 3 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -443,7 +446,6 @@ pytz==2023.3.post1
# -r requirements/test.txt
# babel
# celery
# django
# djangorestframework
# drf-yasg
pywatchman==1.4.1
Expand Down
10 changes: 8 additions & 2 deletions requirements/monitoring/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -724,7 +731,6 @@ pytz==2023.3.post1
# -r requirements/monitoring/../test.txt
# babel
# celery
# django
# djangorestframework
# drf-yasg
pywatchman==1.4.1
Expand Down
8 changes: 5 additions & 3 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -246,7 +249,6 @@ pytz==2023.3.post1
# via
# -r requirements/base.txt
# celery
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down
6 changes: 4 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -340,7 +343,6 @@ pytz==2023.3.post1
# via
# -r requirements/base.txt
# celery
# django
# djangorestframework
# drf-yasg
pyyaml==6.0.1
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tox]
envlist = py38-django{32}
envlist = py38-django{42}
skipsdist = true

[testenv]
passenv = *
deps =
django32: -r requirements/django.txt
django42: -r requirements/django.txt
-r{toxinidir}/requirements/test.txt
whitelist_externals =
i18n_tool
/bin/bash
commands = {posargs:pytest}
commands = {posargs:pytest}

0 comments on commit 8115d8b

Please sign in to comment.