Skip to content

Commit

Permalink
feat!: Upgrade to Django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Sep 28, 2023
1 parent 6696088 commit e3fac51
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 205 deletions.
4 changes: 2 additions & 2 deletions .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, django40, django42, quality, docs, pii_check]
toxenv: [django42, quality, docs, pii_check]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,7 +38,7 @@ jobs:
run: tox

- 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
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,16 @@ migrate: ## apply database migrations
html_coverage: ## generate and view HTML coverage report
coverage html && open htmlcov/index.html

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: piptools $(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
mv requirements/common_constraints.tmp requirements/common_constraints.txt
# Make sure to compile files after any other files they include!
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
27 changes: 12 additions & 15 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async-timeout==4.0.3
backports-zoneinfo[tzdata]==0.2.1
# via
# celery
# django
# kombu
billiard==4.1.0
# via celery
Expand Down Expand Up @@ -45,17 +46,17 @@ coreapi==2.3.3
# openapi-codec
coreschema==0.0.4
# via coreapi
cryptography==41.0.3
cryptography==41.0.4
# via
# pyjwt
# social-auth-core
defusedxml==0.7.1
defusedxml==0.8.0rc1
# via
# python3-openid
# social-auth-core
django==3.2.21
django==4.2.5
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-cors-headers
# django-crum
Expand Down Expand Up @@ -99,9 +100,9 @@ edx-django-utils==5.7.0
# -r requirements/base.in
# edx-drf-extensions
# edx-rest-api-client
edx-drf-extensions==8.9.2
edx-drf-extensions==8.10.0
# via -r requirements/base.in
edx-opaque-keys==2.5.0
edx-opaque-keys==2.5.1
# via edx-drf-extensions
edx-rest-api-client==5.6.0
# via -r requirements/base.in
Expand All @@ -117,7 +118,7 @@ markupsafe==2.1.3
# via jinja2
mysqlclient==2.2.0
# via -r requirements/base.in
newrelic==9.0.0
newrelic==9.1.0
# via edx-django-utils
oauthlib==3.2.2
# via
Expand Down Expand Up @@ -147,15 +148,12 @@ pymongo==3.13.0
pynacl==1.5.0
# via edx-django-utils
python-dateutil==2.8.2
# via
# celery
# edx-drf-extensions
# via celery
python3-openid==3.2.0
# via social-auth-core
pytz==2023.3.post1
# via
# -r requirements/base.in
# django
# djangorestframework
pyyaml==6.0.1
# via edx-django-release-util
Expand All @@ -180,7 +178,6 @@ six==1.16.0
# via
# edx-auth-backends
# edx-django-release-util
# edx-drf-extensions
# python-dateutil
slumber==0.7.1
# via edx-rest-api-client
Expand All @@ -196,9 +193,9 @@ stevedore==5.1.0
# via
# edx-django-utils
# edx-opaque-keys
stripe==6.2.0
stripe==6.6.0
# via -r requirements/base.in
typing-extensions==4.7.1
typing-extensions==4.8.0
# via
# asgiref
# edx-opaque-keys
Expand All @@ -210,7 +207,7 @@ tzdata==2023.3
# celery
uritemplate==4.1.1
# via coreapi
urllib3==2.0.4
urllib3==2.0.5
# via requests
vine==5.0.0
# via
Expand Down
8 changes: 3 additions & 5 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
distlib==0.3.7
# via virtualenv
filelock==3.12.3
filelock==3.12.4
# via
# tox
# virtualenv
Expand All @@ -24,12 +24,10 @@ tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.2
# via -r requirements/ci.in
typing-extensions==4.7.1
# via filelock
virtualenv==20.24.4
virtualenv==20.24.5
# via tox
28 changes: 28 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
# Similar to other constraint files this file doesn't install any packages.
# It specifies version constraints that will be applied if a package is needed.
# When pinning something here, please provide an explanation of why it is a good
# idea to pin this package across all edx repos, Ideally, link to other information
# that will help people in the future to remove the pin when possible.
# Writing an issue against the offending project and linking to it here is good.
#
# Note: Changes to this file will automatically be used by other repos, referencing
# this file from Github directly. It does not require packaging in edx-lint.


# using LTS django version


# 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
tox<4.0.0
5 changes: 4 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
# linking to it here is good.

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
-c common_constraints.txt

# This constraint can be removed once global Django constraint has been updated
Django<4.3
Loading

0 comments on commit e3fac51

Please sign in to comment.