From daebe63086a69b72598308e5dce519c84292c0a6 Mon Sep 17 00:00:00 2001 From: _ <50262751+hunzlahmalik@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:59:47 +0500 Subject: [PATCH] feat: remove django42, upgrade to django52 --- .github/workflows/ci.yml | 2 +- Makefile | 5 +++++ requirements/base.txt | 6 +++--- requirements/common_constraints.txt | 19 +++++++++++++++++++ requirements/constraints.txt | 5 ++++- requirements/django.txt | 2 +- requirements/quality.txt | 6 +++--- requirements/test.txt | 4 ++-- tox.ini | 5 ++--- 9 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 requirements/common_constraints.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb5aa43c..f970d0d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: python-version: ["3.11", "3.12"] - toxenv: ["django42", "django52", "quality", "pii_check", "check_keywords"] + toxenv: ["django52", "quality", "pii_check", "check_keywords"] services: mysql: diff --git a/Makefile b/Makefile index 2082bb82..8419ee8a 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,12 @@ develop: requirements test.requirements piptools: ## install pinned version of pip-compile and pip-sync pip install -r requirements/pip-tools.txt +prepare-common-constraints: + curl -s https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt \ + | grep -iv '^[dD]jango' > requirements/common_constraints.txt + compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade +compile-requirements: prepare-common-constraints compile-requirements: piptools ## Re-compile *.in requirements to *.txt (without upgrading) # Make sure to compile files after any other files they include! pip-compile ${COMPILE_OPTS} --rebuild --allow-unsafe -o requirements/pip.txt requirements/pip.in diff --git a/requirements/base.txt b/requirements/base.txt index 3c068997..598b33d7 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -30,9 +30,9 @@ click==8.3.0 # via edx-django-utils cryptography==46.0.3 # via pyjwt -django==4.2.25 +django==5.2.7 # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.in # django-cors-headers # django-crum @@ -85,7 +85,7 @@ edx-opaque-keys==3.0.0 # via edx-drf-extensions elasticsearch==7.13.4 # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.in # django-elasticsearch-dsl-drf # elasticsearch-dsl diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..be4b4fbe --- /dev/null +++ b/requirements/common_constraints.txt @@ -0,0 +1,19 @@ +# 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 +# See https://github.com/openedx/edx-platform/issues/35126 for more info +elasticsearch<7.14.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index f27b3f35..75c4e390 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -9,4 +9,7 @@ # linking to it here is good. # Common constraints for edx repos --c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt +-c common_constraints.txt + +# Repo-specific override for Django +Django<5.3 \ No newline at end of file diff --git a/requirements/django.txt b/requirements/django.txt index d17004c3..9109eb20 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1 +1 @@ -django==4.2.25 +django==5.2.7 diff --git a/requirements/quality.txt b/requirements/quality.txt index 50f7357d..35c34a73 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -97,9 +97,9 @@ distlib==0.4.0 # via # -r requirements/test.txt # virtualenv -django==4.2.25 +django==5.2.7 # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.txt # -r requirements/test.txt # django-cors-headers @@ -185,7 +185,7 @@ edx-opaque-keys==3.0.0 # edx-drf-extensions elasticsearch==7.13.4 # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.txt # -r requirements/test.txt # django-elasticsearch-dsl-drf diff --git a/requirements/test.txt b/requirements/test.txt index e8d1fee7..671e738c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -72,7 +72,7 @@ dill==0.4.0 distlib==0.4.0 # via virtualenv # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/constraints.txt # -r requirements/base.txt # django-cors-headers # django-crum @@ -136,7 +136,7 @@ edx-opaque-keys==3.0.0 # edx-drf-extensions elasticsearch==7.13.4 # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.txt # django-elasticsearch-dsl-drf # elasticsearch-dsl diff --git a/tox.ini b/tox.ini index 98f5939a..6b961b0a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -envlist = py{311,312}-django{42,52}, quality, pii_check, check_keywords +envlist = py{311,312}-django{52}, quality, pii_check, check_keywords skipsdist = true isolated_build = true # Enable isolated build environments [testenv] envdir = {toxworkdir}/{envname} deps = - django42: Django>=4.2,<5.0 django52: Django>=5.2,<6.0 passenv = CONN_MAX_AGE @@ -37,7 +36,7 @@ envdir = {toxworkdir}/{envname} allowlist_externals = make deps = - Django>=4.2,<5.0 + Django>=5.2,<6.0 commands = make pii_check