Skip to content

Commit

Permalink
feat!: upgrade to django42
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairshakoorarbisoft authored and UsamaSadiq committed Oct 24, 2023
1 parent 9b87fb7 commit f43c397
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ 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):
Expand All @@ -108,6 +112,8 @@ upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
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
# 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
Expand Down
5 changes: 5 additions & 0 deletions edx_exams/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)
Expand Down
17 changes: 9 additions & 8 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ attrs==23.1.0
# via
# lti-consumer-xblock
# openedx-events
backports-zoneinfo==0.2.1
# via django
bleach==6.1.0
# via lti-consumer-xblock
boto3==1.28.64
boto3==1.28.69
# via fs-s3fs
botocore==1.31.64
botocore==1.31.69
# via
# boto3
# s3transfer
Expand All @@ -28,7 +30,7 @@ cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.3.0
charset-normalizer==3.3.1
# via requests
click==8.1.7
# via
Expand All @@ -50,9 +52,9 @@ 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
# django-config-models
Expand Down Expand Up @@ -209,7 +211,7 @@ markupsafe==2.1.3
# xblock
mysqlclient==2.2.0
# via -r requirements/base.in
newrelic==9.1.0
newrelic==9.1.1
# via edx-django-utils
oauthlib==3.2.2
# via
Expand Down Expand Up @@ -270,7 +272,6 @@ python3-openid==3.2.0
pytz==2023.3.post1
# via
# -r requirements/base.in
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -337,7 +338,7 @@ uritemplate==4.1.1
# via
# coreapi
# drf-yasg
urllib3==1.26.17
urllib3==1.26.18
# via
# botocore
# requests
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ tox==3.28.0
# via
# -c requirements/common_constraints.txt
# -r requirements/ci.in
virtualenv==20.24.5
virtualenv==20.24.6
# via tox
6 changes: 5 additions & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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.
Expand All @@ -14,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: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.


Django<4.3

# Common constraints for edx repos
-c common_constraints.txt
45 changes: 15 additions & 30 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ asgiref==3.7.2
# via
# -r requirements/validation.txt
# django
astroid==2.15.8
astroid==3.0.1
# via
# -r requirements/validation.txt
# pylint
Expand All @@ -26,15 +26,19 @@ 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.1.0
# via
# -r requirements/validation.txt
# lti-consumer-xblock
boto3==1.28.64
boto3==1.28.69
# via
# -r requirements/validation.txt
# fs-s3fs
botocore==1.31.64
botocore==1.31.69
# via
# -r requirements/validation.txt
# boto3
Expand All @@ -54,7 +58,7 @@ cffi==1.16.0
# pynacl
chardet==5.2.0
# via diff-cover
charset-normalizer==3.3.0
charset-normalizer==3.3.1
# via
# -r requirements/validation.txt
# requests
Expand Down Expand Up @@ -94,7 +98,6 @@ cryptography==41.0.4
# via
# -r requirements/validation.txt
# pyjwt
# secretstorage
# social-auth-core
ddt==1.6.0
# via -r requirements/validation.txt
Expand All @@ -113,7 +116,7 @@ distlib==0.3.7
# via
# -r requirements/validation.txt
# virtualenv
django==3.2.22
django==4.2.6
# via
# -r requirements/validation.txt
# django-appconf
Expand Down Expand Up @@ -259,7 +262,7 @@ exceptiongroup==1.1.3
# pytest
factory-boy==3.3.0
# via -r requirements/validation.txt
faker==19.10.0
faker==19.11.0
# via
# -r requirements/validation.txt
# factory-boy
Expand Down Expand Up @@ -323,11 +326,6 @@ jaraco-classes==3.3.0
# via
# -r requirements/validation.txt
# keyring
jeepney==0.8.0
# via
# -r requirements/validation.txt
# keyring
# secretstorage
jinja2==3.1.2
# via
# -r requirements/validation.txt
Expand All @@ -352,10 +350,6 @@ lazy==1.6
# -r requirements/validation.txt
# lti-consumer-xblock
# xblock
lazy-object-proxy==1.9.0
# via
# -r requirements/validation.txt
# astroid
lti-consumer-xblock==9.6.2
# via -r requirements/validation.txt
lxml==4.9.3
Expand Down Expand Up @@ -396,7 +390,7 @@ more-itertools==10.1.0
# jaraco-classes
mysqlclient==2.2.0
# via -r requirements/validation.txt
newrelic==9.1.0
newrelic==9.1.1
# via
# -r requirements/validation.txt
# edx-django-utils
Expand Down Expand Up @@ -502,7 +496,7 @@ pyjwt[crypto]==2.8.0
# edx-rest-api-client
# pyjwt
# social-auth-core
pylint==2.17.7
pylint==3.0.2
# via
# -r requirements/validation.txt
# edx-lint
Expand All @@ -513,7 +507,7 @@ pylint-celery==0.3
# via
# -r requirements/validation.txt
# edx-lint
pylint-django==2.5.3
pylint-django==2.5.5
# via
# -r requirements/validation.txt
# edx-lint
Expand Down Expand Up @@ -563,7 +557,6 @@ python3-openid==3.2.0
pytz==2023.3.post1
# via
# -r requirements/validation.txt
# django
# djangorestframework
# drf-yasg
# xblock
Expand Down Expand Up @@ -619,10 +612,6 @@ s3transfer==0.7.0
# via
# -r requirements/validation.txt
# boto3
secretstorage==3.3.3
# via
# -r requirements/validation.txt
# keyring
semantic-version==2.10.0
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -715,14 +704,14 @@ uritemplate==4.1.1
# -r requirements/validation.txt
# coreapi
# drf-yasg
urllib3==1.26.17
urllib3==1.26.18
# via
# -r requirements/validation.txt
# botocore
# requests
# responses
# twine
virtualenv==20.24.5
virtualenv==20.24.6
# via
# -r requirements/validation.txt
# tox
Expand All @@ -747,10 +736,6 @@ wheel==0.41.2
# via
# -r requirements/pip-tools.txt
# pip-tools
wrapt==1.15.0
# via
# -r requirements/validation.txt
# astroid
xblock[django]==1.8.1
# via
# -r requirements/validation.txt
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
Loading

0 comments on commit f43c397

Please sign in to comment.