From 365b76bf221bb2c2dafefb8957f986db0514482e Mon Sep 17 00:00:00 2001 From: Naincy Chourasia Date: Wed, 30 Sep 2026 07:31:34 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20add=20Python=203.12=20support=20and=20d?= =?UTF-8?q?rop=20Python=203.8=E2=80=933.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 22 +++---- .../workflows/upgrade-python-requirements.yml | 1 + analyticsclient/course_summaries.py | 2 +- requirements/base.txt | 14 ++-- requirements/common_constraints.txt | 35 ++++++---- requirements/pip-tools.txt | 33 ++++------ requirements/pip.txt | 14 ++-- requirements/test.txt | 65 +++++++++---------- requirements/tox.txt | 33 +++++----- setup.py | 3 +- tox.ini | 2 +- 11 files changed, 115 insertions(+), 109 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0e2b3c..f1f4498 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,18 +15,13 @@ jobs: strategy: matrix: os: - - ubuntu-20.04 - python-version: ['3.8', '3.12'] - toxenv: [py38,py312,quality] - exclude: - - python-version: '3.8' - toxenv: 'py312' - - python-version: '3.12' - toxenv: 'py38' + - ubuntu-24.04 + python-version: ['3.12'] + toxenv: [py312,quality] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -41,7 +36,8 @@ jobs: run: tox - name: Run Coverage - if: matrix.toxenv=='py38' - uses: codecov/codecov-action@v2 + if: matrix.toxenv=='py312' + uses: codecov/codecov-action@v5 with: - fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml index 7956310..8fea9c8 100644 --- a/.github/workflows/upgrade-python-requirements.yml +++ b/.github/workflows/upgrade-python-requirements.yml @@ -15,6 +15,7 @@ jobs: uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master with: branch: ${{ github.event.inputs.branch || 'master' }} + python_version: "3.12" email_address: "cosmonauts-requirements-update@2u-internal.opsgenie.net" send_success_notification: true secrets: diff --git a/analyticsclient/course_summaries.py b/analyticsclient/course_summaries.py index dceb6a5..99aa69d 100644 --- a/analyticsclient/course_summaries.py +++ b/analyticsclient/course_summaries.py @@ -9,7 +9,7 @@ class CourseSummaries(PostableCourseIDsEndpoint): path = 'course_summaries/' - def course_summaries( + def course_summaries( # pylint: disable=too-many-positional-arguments self, course_ids=None, availability=None, diff --git a/requirements/base.txt b/requirements/base.txt index 1b5bd4d..169cedd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,20 +1,20 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -certifi==2024.2.2 +certifi==2026.7.22 # via requests -charset-normalizer==3.3.2 +charset-normalizer==3.5.1 # via requests -idna==3.7 +idna==3.20 # via requests -requests==2.31.0 +requests==2.34.2 # via -r requirements/base.in -urllib3==2.2.1 +urllib3==2.8.0 # via requests # The following packages are considered to be unsafe in a requirements file: -setuptools==69.5.1 +setuptools==84.0.0 # via -r requirements/base.in diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index e3bf8ea..f60f86e 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -11,22 +11,33 @@ # 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 -Django<5.0 +Django<6.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 +# See https://github.com/openedx/edx-platform/issues/35126 for more info 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 +# 2026-07-06: Constrain social-auth-* packages to the latest version compatible with +# edx-drf-extensions<=10.6.0. (Newer versions require a POST instead of a GET.) +# Tracking issue: https://github.com/openedx/edx-drf-extensions/issues/561 +social-auth-app-django<6.0.0 +social-auth-core<5.0.0 -# opentelemetry requires version 6.x at the moment: -# https://github.com/open-telemetry/opentelemetry-python/issues/3570 -# Normally this could be added as a constraint in edx-django-utils, where we're -# adding the opentelemetry dependency. However, when we compile pip-tools.txt, -# that uses version 7.x, and then there's no undoing that when compiling base.txt. -# So we need to pin it globally, for now. -# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407 -importlib-metadata<7 +# 2026-08-11: pip-tools is only tested against the latest pip released at the time +# pip-tools was released; also, pip-tools package dependencies are extremely permissive +# about the pip version required, so the dependency resolver will not prevent an unwanted +# pip upgrade which would break pip-tools. The end result is that pip MUST be constrained +# by all pip-tools users in order to avoid potentially weeks-long lapses in pip <-> +# pip-tools compatibility. We've constrained pip here in common_constraints.txt in the +# past, but always removed it once the issue was "fixed". Removing this constraint was +# always a mistake. +# +# This is a semi-permanent constraint and should be manually bumped after each pip-tools +# release. +# +# Exceptional conditions for removal: +# - We stop using pip-tools, OR +# - We migrate to the proposed `pip-tools[stable]` extra: https://github.com/jazzband/pip-tools/pull/2257 +pip<26.2.1 # Known to work with pip-tools==7.6.1 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index b4d10f7..9bcb4b7 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,37 +1,30 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -build==1.2.1 +build==1.6.1 # via pip-tools -click==8.1.7 +click==8.5.0 # via pip-tools -importlib-metadata==6.11.0 +packaging==26.3 # via - # -c requirements/common_constraints.txt # build -packaging==24.0 - # via build -pip-tools==7.4.1 + # wheel +pip-tools==7.6.1 # via -r requirements/pip-tools.in -pyproject-hooks==1.0.0 - # via - # build - # pip-tools -tomli==2.0.1 +pyproject-hooks==1.3.3 # via # build # pip-tools - # pyproject-hooks -wheel==0.43.0 +wheel==0.48.0 # via pip-tools -zipp==3.18.1 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via pip-tools -setuptools==69.5.1 +pip==26.2 + # via + # -c requirements/common_constraints.txt + # pip-tools +setuptools==84.0.0 # via pip-tools diff --git a/requirements/pip.txt b/requirements/pip.txt index e3ffcc7..582d620 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,14 +1,18 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -wheel==0.43.0 +packaging==26.3 + # via wheel +wheel==0.48.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r requirements/pip.in -setuptools==69.5.1 +pip==26.2 + # via + # -c requirements/common_constraints.txt + # -r requirements/pip.in +setuptools==84.0.0 # via -r requirements/pip.in diff --git a/requirements/test.txt b/requirements/test.txt index 0d81536..df55287 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,81 +1,78 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -astroid==3.1.0 +astroid==4.0.4 # via pylint -certifi==2024.2.2 +certifi==2026.7.22 # via # -r requirements/base.txt # requests -charset-normalizer==3.3.2 +charset-normalizer==3.5.1 # via # -r requirements/base.txt # requests -coverage[toml]==7.4.4 +coverage[toml]==7.16.2 # via # -r requirements/test.in # pytest-cov ddt==1.7.2 # via -r requirements/test.in -dill==0.3.8 +dill==0.4.1 # via pylint -exceptiongroup==1.2.0 - # via pytest httpretty==1.1.4 # via -r requirements/test.in -idna==3.7 +idna==3.20 # via # -r requirements/base.txt # requests -iniconfig==2.0.0 +iniconfig==2.3.0 # via pytest -isort==5.13.2 +isort==9.0.1 # via pylint mccabe==0.7.0 # via pylint -packaging==24.0 +mypy-extensions==1.1.0 + # via isort +packaging==26.3 # via pytest -platformdirs==4.2.0 +platformdirs==4.12.1 # via pylint -pluggy==1.4.0 - # via pytest -pycodestyle==2.11.1 +pluggy==1.6.0 + # via + # pytest + # pytest-cov +pycodestyle==2.15.0 # via -r requirements/test.in pydocstyle==6.3.0 # via -r requirements/test.in -pylint==3.1.0 +pygments==2.21.0 + # via pytest +pylint==4.0.9 # via -r requirements/test.in -pytest==8.1.1 +pytest==9.1.1 # via # -r requirements/test.in # pytest-cov -pytest-cov==5.0.0 +pytest-cov==7.1.0 # via -r requirements/test.in -requests==2.31.0 +requests==2.34.2 # via -r requirements/base.txt -snowballstemmer==2.2.0 +snowballstemmer==3.1.1 # via pydocstyle -testfixtures==8.1.0 +testfixtures==12.3.0 # via -r requirements/test.in -tomli==2.0.1 - # via - # coverage - # pylint - # pytest -tomlkit==0.12.4 +tomlkit==0.15.1 # via pylint -typing-extensions==4.11.0 - # via - # astroid - # pylint -urllib3==2.2.1 +typing-extensions==4.16.0 + # via testfixtures +urllib3==2.8.0 # via # -r requirements/base.txt # requests # The following packages are considered to be unsafe in a requirements file: -setuptools==69.5.1 +setuptools==84.0.0 # via -r requirements/base.txt diff --git a/requirements/tox.txt b/requirements/tox.txt index 5bd295a..2e62e2b 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,40 +1,43 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -cachetools==5.3.3 - # via tox -chardet==5.2.0 +cachetools==7.2.0 # via tox colorama==0.4.6 # via tox -coverage==7.4.4 +coverage==7.16.2 # via -r requirements/tox.in -distlib==0.3.8 +distlib==0.4.3 # via virtualenv -filelock==3.13.4 +filelock==4.0.5 # via + # python-discovery # tox # virtualenv -packaging==24.0 +packaging==26.3 # via # pyproject-api # tox -platformdirs==4.2.0 +platformdirs==4.12.1 # via # tox # virtualenv -pluggy==1.4.0 +pluggy==1.6.0 # via tox -pyproject-api==1.6.1 +pyproject-api==1.11.2 # via tox -tomli==2.0.1 +python-discovery==1.6.1 # via - # pyproject-api # tox -tox==4.14.2 + # virtualenv +tomli-w==1.2.0 + # via tox +tox==4.64.4 # via -r requirements/tox.in -virtualenv==20.25.1 +typing-extensions==4.16.0 + # via tox +virtualenv==21.13.0 # via tox diff --git a/setup.py b/setup.py index c381b2f..bdaf5d4 100644 --- a/setup.py +++ b/setup.py @@ -68,8 +68,9 @@ def get_version(*file_paths): 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.12', ], + python_requires='>=3.12', install_requires=load_requirements('requirements/base.in'), test_requires=load_requirements('requirements/base.in') ) diff --git a/tox.ini b/tox.ini index f01eefb..762a60c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38,312},quality +envlist = py312,quality [testenv] deps = -r{toxinidir}/requirements/test.txt