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

Commit

Permalink
feat!: upgrade to django 4.2 LTS (#1511)
Browse files Browse the repository at this point in the history
* feat!: upgrade to django 4.2 LTS

* fix: update settings for pytz
  • Loading branch information
UsamaSadiq authored Oct 6, 2023
1 parent 5760bb8 commit 2e50e81
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
python-version: ["3.8"]
os: [ubuntu-20.04]
toxenv: [django32, django42]
toxenv: [django42]
node: [16]
env:
DATA_API_VERSION: "latest"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ $(COMMON_CONSTRAINTS_TXT):

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(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 install -qr requirements/pip_tools.txt ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
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
Expand Down
3 changes: 3 additions & 0 deletions analytics_dashboard/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True

# Keep using deprecated pytz with Django>4.2
USE_DEPRECATED_PYTZ = True

FORMAT_MODULE_PATH = 'core.formats'
########## END GENERAL CONFIGURATION

Expand Down
9 changes: 4 additions & 5 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ asgiref==3.7.2
# via
# django
# django-countries
backports-zoneinfo==0.2.1
# via django
certifi==2023.7.22
# via requests
cffi==1.16.0
Expand All @@ -32,9 +34,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-appconf
Expand Down Expand Up @@ -170,9 +171,7 @@ python-slugify==8.0.1
python3-openid==3.2.0
# via social-auth-core
pytz==2023.3.post1
# via
# django
# djangorestframework
# via djangorestframework
pyyaml==6.0.1
# via
# code-annotations
Expand Down
2 changes: 1 addition & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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
4 changes: 2 additions & 2 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# Newer version of django-webpack-loader is not compatible with npm webpack-bundle-tracker > 0.4.3
django-webpack-loader==0.7.0

# Constraint Django to 3.2 LTS
django<3.3
# Constraint Django to 4.2 LTS
django<4.3

# urllib3 > 2.0.2 introduces an error
urllib3>=1.26.15, <2
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
1 change: 0 additions & 1 deletion requirements/django42.txt

This file was deleted.

8 changes: 5 additions & 3 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ babel==2.13.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
beautifulsoup4==4.12.2
# via pydata-sphinx-theme
certifi==2023.7.22
Expand Down Expand Up @@ -53,9 +57,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-appconf
Expand Down Expand Up @@ -244,7 +247,6 @@ pytz==2023.3.post1
# via
# -r requirements/base.txt
# babel
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down
8 changes: 5 additions & 3 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ astroid==2.15.8
# -r requirements/test.txt
# pylint
# pylint-celery
backports-zoneinfo==0.2.1
# via
# -r requirements/test.txt
# django
bok-choy==2.0.2
# via -r requirements/test.txt
build==1.0.3
Expand Down Expand Up @@ -77,9 +81,8 @@ distlib==0.3.7
# via
# -r requirements/tox.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-appconf
Expand Down Expand Up @@ -354,7 +357,6 @@ python3-openid==3.2.0
pytz==2023.3.post1
# via
# -r requirements/test.txt
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down
8 changes: 5 additions & 3 deletions requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ asgiref==3.7.2
# -r requirements/base.txt
# django
# django-countries
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
certifi==2023.7.22
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -43,9 +47,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-appconf
Expand Down Expand Up @@ -225,7 +228,6 @@ python3-openid==3.2.0
pytz==2023.3.post1
# via
# -r requirements/base.txt
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down
6 changes: 4 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ astroid==2.15.8
# -r requirements/test.in
# pylint
# pylint-celery
backports-zoneinfo==0.2.1
# via
# -r requirements/base.txt
# django
bok-choy==2.0.2
# via -r requirements/test.in
certifi==2023.7.22
Expand Down Expand Up @@ -64,7 +68,6 @@ defusedxml==0.8.0rc2
dill==0.3.7
# via pylint
# via
# -c requirements/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-appconf
Expand Down Expand Up @@ -284,7 +287,6 @@ python3-openid==3.2.0
pytz==2023.3.post1
# via
# -r requirements/base.txt
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32, 42}
envlist = py38-django{42}
skipsdist = true

[pytest]
Expand All @@ -22,8 +22,7 @@ passenv =
SELENIUM_BROWSER
BOKCHOY_HEADLESS
deps =
django32: -r requirements/django.txt
django42: -r requirements/django42.txt
django42: -r requirements/django.txt
-r {toxinidir}/requirements/test.txt
allowlist_externals =
make
Expand Down

0 comments on commit 2e50e81

Please sign in to comment.