From db650276730768b1a34dad26d8d05076ad2886bb Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Tue, 20 Feb 2024 13:02:43 +0500 Subject: [PATCH 1/6] feat: add support for python 3.12 --- .github/workflows/ci.yml | 5 +++-- CHANGELOG.rst | 6 ++++-- requirements/ci.txt | 2 +- requirements/dev.txt | 22 +++++++++++----------- requirements/doc.txt | 14 +++++++------- requirements/pip.txt | 2 +- requirements/quality.txt | 16 ++++++++-------- requirements/test.txt | 14 +++++++------- setup.py | 4 ++-- tox.ini | 4 ++-- 10 files changed, 46 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a87e846..3b973077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,11 @@ jobs: name: Tests runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [quality, django32-drf314, django32-drflatest, django42-drf314, django42-drflatest] + python-version: ['3.8', '3.12'] + toxenv: [quality, django42-drf314, django42-drflatest] steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 17d9aede..f88f6736 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,8 +11,10 @@ Change Log .. There should always be an "Unreleased" section for changes pending release. -Unreleased ----------- +[4.6.0] - 2024-4-16 +------------------- + +* Add support for Python 3.12 [4.5.0] - 2024-3-19 -------------------- diff --git a/requirements/ci.txt b/requirements/ci.txt index 7dec1e21..33114184 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -6,7 +6,7 @@ # distlib==0.3.8 # via virtualenv -filelock==3.13.3 +filelock==3.13.4 # via # tox # virtualenv diff --git a/requirements/dev.txt b/requirements/dev.txt index 196bfd2a..1d8b340f 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -16,7 +16,7 @@ astroid==3.1.0 # pylint-celery attrs==23.2.0 # via openedx-events -backports-tarfile==1.0.0 +backports-tarfile==1.1.0 # via jaraco-context backports-zoneinfo[tzdata]==0.2.1 # via @@ -70,7 +70,7 @@ cryptography==42.0.5 # secretstorage ddt==1.7.2 # via -r requirements/test.in -diff-cover==8.0.3 +diff-cover==9.0.0 # via -r requirements/dev.in dill==0.3.8 # via pylint @@ -119,7 +119,7 @@ edx-django-utils==5.12.0 # openedx-events edx-drf-extensions==10.3.0 # via -r requirements/base.in -edx-i18n-tools==1.3.0 +edx-i18n-tools==1.5.0 # via -r requirements/dev.in edx-lint==5.3.6 # via @@ -134,17 +134,17 @@ edx-toggles==5.2.0 # via # -r requirements/base.in # event-tracking -event-tracking==2.3.2 +event-tracking==2.4.0 # via -r requirements/base.in exceptiongroup==1.2.0 # via pytest factory-boy==3.3.0 # via -r requirements/test.in -faker==24.7.1 +faker==24.9.0 # via factory-boy fastavro==1.9.4 # via openedx-events -filelock==3.13.3 +filelock==3.13.4 # via # tox # virtualenv @@ -152,7 +152,7 @@ freezegun==1.4.0 # via -r requirements/test.in fs==2.4.16 # via xblock -idna==3.6 +idna==3.7 # via requests importlib-metadata==7.1.0 # via @@ -183,13 +183,13 @@ jinja2==3.1.3 # diff-cover keyring==25.1.0 # via twine -kombu==5.3.6 +kombu==5.3.7 # via celery lxml==5.2.1 # via # edx-i18n-tools # xblock -mako==1.3.2 +mako==1.3.3 # via xblock markdown-it-py==3.0.0 # via rich @@ -212,7 +212,7 @@ newrelic==9.8.0 # via edx-django-utils nh3==0.2.17 # via readme-renderer -openedx-events==9.7.0 +openedx-events==9.9.1 # via event-tracking packaging==24.0 # via @@ -338,7 +338,7 @@ six==1.16.0 # tox snowballstemmer==2.2.0 # via pydocstyle -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via diff --git a/requirements/doc.txt b/requirements/doc.txt index 0bf7f415..408983ac 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -118,13 +118,13 @@ edx-toggles==5.2.0 # via # -r requirements/base.in # event-tracking -event-tracking==2.3.2 +event-tracking==2.4.0 # via -r requirements/base.in exceptiongroup==1.2.0 # via pytest factory-boy==3.3.0 # via -r requirements/test.in -faker==24.7.1 +faker==24.9.0 # via factory-boy fastavro==1.9.4 # via openedx-events @@ -132,7 +132,7 @@ freezegun==1.4.0 # via -r requirements/test.in fs==2.4.16 # via xblock -idna==3.6 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx @@ -144,11 +144,11 @@ jinja2==3.1.3 # via # code-annotations # sphinx -kombu==5.3.6 +kombu==5.3.7 # via celery lxml==5.2.1 # via xblock -mako==1.3.2 +mako==1.3.3 # via xblock markupsafe==2.1.5 # via @@ -159,7 +159,7 @@ mock==5.1.0 # via -r requirements/test.in newrelic==9.8.0 # via edx-django-utils -openedx-events==9.7.0 +openedx-events==9.9.1 # via event-tracking packaging==24.0 # via @@ -259,7 +259,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via diff --git a/requirements/pip.txt b/requirements/pip.txt index cf449024..e3ffcc7b 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -10,5 +10,5 @@ wheel==0.43.0 # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r requirements/pip.in -setuptools==69.2.0 +setuptools==69.5.1 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index 795ee229..b32f39b4 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -16,7 +16,7 @@ astroid==3.1.0 # pylint-celery attrs==23.2.0 # via openedx-events -backports-tarfile==1.0.0 +backports-tarfile==1.1.0 # via jaraco-context backports-zoneinfo[tzdata]==0.2.1 # via @@ -120,13 +120,13 @@ edx-toggles==5.2.0 # via # -r requirements/base.in # event-tracking -event-tracking==2.3.2 +event-tracking==2.4.0 # via -r requirements/base.in exceptiongroup==1.2.0 # via pytest factory-boy==3.3.0 # via -r requirements/test.in -faker==24.7.1 +faker==24.9.0 # via factory-boy fastavro==1.9.4 # via openedx-events @@ -134,7 +134,7 @@ freezegun==1.4.0 # via -r requirements/test.in fs==2.4.16 # via xblock -idna==3.6 +idna==3.7 # via requests importlib-metadata==7.1.0 # via @@ -162,11 +162,11 @@ jinja2==3.1.3 # via code-annotations keyring==25.1.0 # via twine -kombu==5.3.6 +kombu==5.3.7 # via celery lxml==5.2.1 # via xblock -mako==1.3.2 +mako==1.3.3 # via xblock markdown-it-py==3.0.0 # via rich @@ -189,7 +189,7 @@ newrelic==9.8.0 # via edx-django-utils nh3==0.2.17 # via readme-renderer -openedx-events==9.7.0 +openedx-events==9.9.1 # via event-tracking packaging==24.0 # via pytest @@ -292,7 +292,7 @@ six==1.16.0 # python-dateutil snowballstemmer==2.2.0 # via pydocstyle -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via diff --git a/requirements/test.txt b/requirements/test.txt index 40063573..835c0b43 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -98,13 +98,13 @@ edx-toggles==5.2.0 # via # -r requirements/base.in # event-tracking -event-tracking==2.3.2 +event-tracking==2.4.0 # via -r requirements/base.in exceptiongroup==1.2.0 # via pytest factory-boy==3.3.0 # via -r requirements/test.in -faker==24.7.1 +faker==24.9.0 # via factory-boy fastavro==1.9.4 # via openedx-events @@ -112,17 +112,17 @@ freezegun==1.4.0 # via -r requirements/test.in fs==2.4.16 # via xblock -idna==3.6 +idna==3.7 # via requests iniconfig==2.0.0 # via pytest jinja2==3.1.3 # via code-annotations -kombu==5.3.6 +kombu==5.3.7 # via celery lxml==5.2.1 # via xblock -mako==1.3.2 +mako==1.3.3 # via xblock markupsafe==2.1.5 # via @@ -133,7 +133,7 @@ mock==5.1.0 # via -r requirements/test.in newrelic==9.8.0 # via edx-django-utils -openedx-events==9.7.0 +openedx-events==9.9.1 # via event-tracking packaging==24.0 # via pytest @@ -194,7 +194,7 @@ six==1.16.0 # event-tracking # fs # python-dateutil -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via diff --git a/setup.py b/setup.py index d551a166..017bb57a 100644 --- a/setup.py +++ b/setup.py @@ -125,12 +125,12 @@ def add_version_constraint_or_raise(current_line, current_requirements, add_if_n classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.12', ], ) diff --git a/tox.ini b/tox.ini index c61bfd6f..e5e893cb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = drf{314,latest},py38-django{32,42} +envlist = drf{314,latest},py{38,312}-django{42} [doc8] max-line-length = 120 @@ -19,7 +19,6 @@ norecursedirs = .* docs requirements [testenv] deps = - django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 drf314: djangorestframework<3.15.0 drflatest: djangorestframework @@ -51,6 +50,7 @@ allowlist_externals = rm touch deps = + wheel -r{toxinidir}/requirements/quality.txt commands = pylint completion From aa85d70063bc376c5bcb0064be49462cd7d0f875 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Mon, 8 Apr 2024 16:32:51 +0500 Subject: [PATCH 2/6] fix: add support for python 3.11 --- .github/workflows/ci.yml | 2 +- CHANGELOG.rst | 2 +- Makefile | 28 ++-- completion/__init__.py | 2 +- requirements/base.in | 1 + requirements/base.txt | 208 ++++++++++++++++++++++++++++ requirements/ci.txt | 26 ++-- requirements/common_constraints.txt | 32 +++++ requirements/constraints.txt | 9 +- requirements/dev.txt | 34 +++-- requirements/doc.txt | 15 +- requirements/pip-tools.txt | 6 +- requirements/quality.txt | 17 ++- requirements/test.txt | 8 +- setup.py | 1 + tox.ini | 3 +- 16 files changed, 334 insertions(+), 60 deletions(-) create mode 100644 requirements/base.txt create mode 100644 requirements/common_constraints.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b973077..bbbe7e75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04] - python-version: ['3.8', '3.12'] + python-version: ['3.8', '3.11', '3.12'] toxenv: [quality, django42-drf314, django42-drflatest] steps: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f88f6736..d64a8114 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,7 +14,7 @@ Change Log [4.6.0] - 2024-4-16 ------------------- -* Add support for Python 3.12 +* Add support for Python 3.11 and 3.12 [4.5.0] - 2024-3-19 -------------------- diff --git a/Makefile b/Makefile index 5a6c4a30..8c07546b 100644 --- a/Makefile +++ b/Makefile @@ -41,22 +41,28 @@ docs: ## generate Sphinx HTML documentation, including API docs tox -e docs $(BROWSER) docs/_build/html/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 "$(@)" + upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade -upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in +upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in pip install -qr requirements/pip-tools.txt - pip-compile --rebuild --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in - pip-compile --rebuild --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in + # 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 pip install -qr requirements/pip.txt pip install -qr requirements/pip-tools.txt - pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/dev.in - pip-compile --rebuild --upgrade -o requirements/doc.txt requirements/doc.in - pip-compile --rebuild --upgrade -o requirements/quality.txt requirements/quality.in - pip-compile --rebuild --upgrade -o requirements/test.txt requirements/test.in - pip-compile --rebuild --upgrade -o requirements/ci.txt requirements/ci.in + pip-compile --upgrade --allow-unsafe -o requirements/base.txt requirements/base.in + pip-compile --upgrade -o requirements/test.txt requirements/test.in + pip-compile --upgrade -o requirements/doc.txt requirements/doc.in + pip-compile --upgrade --allow-unsafe -o requirements/quality.txt requirements/quality.in + pip-compile --upgrade -o requirements/ci.txt requirements/ci.in + pip-compile --upgrade -o requirements/dev.txt requirements/dev.in # Let tox control the Django version for tests - sed -i.tmp '/^[d|D]jango==/d' requirements/test.txt - sed -i.tmp '/^djangorestframework==/d' requirements/test.txt - rm requirements/test.txt.tmp + sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp + mv requirements/test.tmp requirements/test.txt quality: ## check coding style with pycodestyle and pylint tox -e quality diff --git a/completion/__init__.py b/completion/__init__.py index 142bd91a..9adf5d25 100644 --- a/completion/__init__.py +++ b/completion/__init__.py @@ -3,4 +3,4 @@ """ -__version__ = '4.5.0' +__version__ = '4.6.0' diff --git a/requirements/base.in b/requirements/base.in index a24d40ac..57336409 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -10,3 +10,4 @@ edx-toggles>=1.2.0 pytz XBlock>=1.2.2 event-tracking +setuptools diff --git a/requirements/base.txt b/requirements/base.txt new file mode 100644 index 00000000..e879dc8a --- /dev/null +++ b/requirements/base.txt @@ -0,0 +1,208 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# make upgrade +# +amqp==5.2.0 + # via kombu +appdirs==1.4.4 + # via fs +asgiref==3.8.1 + # via django +attrs==23.2.0 + # via openedx-events +backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # celery + # django + # djangorestframework + # kombu +billiard==4.2.0 + # via celery +celery==5.3.6 + # via event-tracking +certifi==2024.2.2 + # via requests +cffi==1.16.0 + # via + # cryptography + # pynacl +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via + # celery + # click-didyoumean + # click-plugins + # click-repl + # code-annotations + # edx-django-utils +click-didyoumean==0.3.1 + # via celery +click-plugins==1.1.1 + # via celery +click-repl==0.3.0 + # via celery +code-annotations==1.8.0 + # via edx-toggles +cryptography==42.0.5 + # via pyjwt +django==4.2.11 + # via + # -c requirements/common_constraints.txt + # -r requirements/base.in + # django-crum + # django-model-utils + # django-waffle + # djangorestframework + # drf-jwt + # edx-django-utils + # edx-drf-extensions + # edx-toggles + # event-tracking + # openedx-events +django-crum==0.7.9 + # via + # edx-django-utils + # edx-toggles +django-model-utils==4.5.0 + # via -r requirements/base.in +django-waffle==4.1.0 + # via + # edx-django-utils + # edx-drf-extensions + # edx-toggles +djangorestframework==3.15.1 + # via + # -r requirements/base.in + # drf-jwt + # edx-drf-extensions +drf-jwt==1.19.2 + # via edx-drf-extensions +edx-django-utils==5.12.0 + # via + # edx-drf-extensions + # edx-toggles + # event-tracking + # openedx-events +edx-drf-extensions==10.3.0 + # via -r requirements/base.in +edx-opaque-keys[django]==2.5.1 + # via + # -r requirements/base.in + # edx-drf-extensions + # openedx-events +edx-toggles==5.2.0 + # via + # -r requirements/base.in + # event-tracking +event-tracking==2.4.0 + # via -r requirements/base.in +fastavro==1.9.4 + # via openedx-events +fs==2.4.16 + # via xblock +idna==3.7 + # via requests +jinja2==3.1.3 + # via code-annotations +kombu==5.3.7 + # via celery +lxml==5.2.1 + # via xblock +mako==1.3.3 + # via xblock +markupsafe==2.1.5 + # via + # jinja2 + # mako + # xblock +newrelic==9.8.0 + # via edx-django-utils +openedx-events==9.9.1 + # via event-tracking +pbr==6.0.0 + # via stevedore +prompt-toolkit==3.0.43 + # via click-repl +psutil==5.9.8 + # via edx-django-utils +pycparser==2.22 + # via cffi +pyjwt[crypto]==2.8.0 + # via + # drf-jwt + # edx-drf-extensions +pymongo==3.13.0 + # via + # edx-opaque-keys + # event-tracking +pynacl==1.5.0 + # via edx-django-utils +python-dateutil==2.9.0.post0 + # via + # celery + # xblock +python-slugify==8.0.4 + # via code-annotations +pytz==2024.1 + # via + # -r requirements/base.in + # event-tracking + # xblock +pyyaml==6.0.1 + # via + # code-annotations + # xblock +requests==2.31.0 + # via edx-drf-extensions +semantic-version==2.10.0 + # via edx-drf-extensions +simplejson==3.19.2 + # via xblock +six==1.16.0 + # via + # event-tracking + # fs + # python-dateutil +sqlparse==0.5.0 + # via django +stevedore==5.2.0 + # via + # code-annotations + # edx-django-utils + # edx-opaque-keys +text-unidecode==1.3 + # via python-slugify +typing-extensions==4.11.0 + # via + # asgiref + # edx-opaque-keys + # kombu +tzdata==2024.1 + # via + # backports-zoneinfo + # celery +urllib3==2.2.1 + # via requests +vine==5.1.0 + # via + # amqp + # celery + # kombu +wcwidth==0.2.13 + # via prompt-toolkit +web-fragments==2.2.0 + # via xblock +webob==1.8.7 + # via xblock +xblock==3.1.0 + # via -r requirements/base.in + +# The following packages are considered to be unsafe in a requirements file: +setuptools==69.5.1 + # via + # -r requirements/base.in + # fs diff --git a/requirements/ci.txt b/requirements/ci.txt index 33114184..acc6d0a3 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -4,6 +4,12 @@ # # make upgrade # +cachetools==5.3.3 + # via tox +chardet==5.2.0 + # via tox +colorama==0.4.6 + # via tox distlib==0.3.8 # via virtualenv filelock==3.13.4 @@ -13,20 +19,22 @@ filelock==3.13.4 mock==5.1.0 # via -r requirements/ci.in packaging==24.0 - # via tox + # via + # pyproject-api + # tox platformdirs==4.2.0 - # via virtualenv + # via + # tox + # virtualenv pluggy==1.4.0 # via tox -py==1.11.0 - # via tox -six==1.16.0 +pyproject-api==1.6.1 # via tox tomli==2.0.1 - # via tox -tox==3.28.0 # via - # -c requirements/constraints.txt - # -r requirements/ci.in + # pyproject-api + # tox +tox==4.14.2 + # via -r requirements/ci.in virtualenv==20.25.1 # via tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..e3bf8eae --- /dev/null +++ b/requirements/common_constraints.txt @@ -0,0 +1,32 @@ +# 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 +Django<5.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 +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 + +# 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 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 716bcfd5..810e8f0c 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -1,4 +1,4 @@ -# Version constraints for pip installation. +# Version constraints for pip-installation. # # This file doesn't install any packages. It specifies version constraints # that will be applied if a package is needed. @@ -8,8 +8,7 @@ # pin when possible. Writing an issue against the offending project and # linking to it here is good. -Django < 3.3 +-c common_constraints.txt -# tox >= 4.0.0 is a complete rewrite of the tox package. It is not a -# simple upgrade. I've pinned the version to allow us to time to prioritize this upgrade. -tox < 4.0.0 \ No newline at end of file +# Temporary to Support the python 3.11 Upgrade +backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/requirements/dev.txt b/requirements/dev.txt index 1d8b340f..7a681cd6 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -18,15 +18,19 @@ attrs==23.2.0 # via openedx-events backports-tarfile==1.1.0 # via jaraco-context -backports-zoneinfo[tzdata]==0.2.1 +backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # celery + # django # djangorestframework # kombu billiard==4.2.0 # via celery build==1.2.1 # via pip-tools +cachetools==5.3.3 + # via tox celery==5.3.6 # via event-tracking certifi==2024.2.2 @@ -36,7 +40,9 @@ cffi==1.16.0 # cryptography # pynacl chardet==5.2.0 - # via diff-cover + # via + # diff-cover + # tox charset-normalizer==3.3.2 # via requests click==8.1.7 @@ -62,6 +68,8 @@ code-annotations==1.8.0 # via # edx-lint # edx-toggles +colorama==0.4.6 + # via tox coverage[toml]==7.4.4 # via pytest-cov cryptography==42.0.5 @@ -76,9 +84,9 @@ dill==0.3.8 # via pylint distlib==0.3.8 # via virtualenv -django==3.2.25 +django==4.2.11 # via - # -c requirements/constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.in # django-crum # django-model-utils @@ -154,8 +162,9 @@ fs==2.4.16 # via xblock idna==3.7 # via requests -importlib-metadata==7.1.0 +importlib-metadata==6.11.0 # via + # -c requirements/common_constraints.txt # build # keyring # twine @@ -217,6 +226,7 @@ openedx-events==9.9.1 packaging==24.0 # via # build + # pyproject-api # pytest # tox path==16.14.0 @@ -230,6 +240,7 @@ pkginfo==1.10.0 platformdirs==4.2.0 # via # pylint + # tox # virtualenv pluggy==1.4.0 # via @@ -242,8 +253,6 @@ prompt-toolkit==3.0.43 # via click-repl psutil==5.9.8 # via edx-django-utils -py==1.11.0 - # via tox pycodestyle==2.11.1 # via -r requirements/quality.in pycparser==2.22 @@ -279,6 +288,8 @@ pymongo==3.13.0 # event-tracking pynacl==1.5.0 # via edx-django-utils +pyproject-api==1.6.1 + # via tox pyproject-hooks==1.0.0 # via # build @@ -302,7 +313,6 @@ python-slugify==8.0.4 pytz==2024.1 # via # -r requirements/base.in - # django # event-tracking # xblock pyyaml==6.0.1 @@ -335,7 +345,6 @@ six==1.16.0 # event-tracking # fs # python-dateutil - # tox snowballstemmer==2.2.0 # via pydocstyle sqlparse==0.5.0 @@ -353,15 +362,14 @@ tomli==2.0.1 # coverage # pip-tools # pylint + # pyproject-api # pyproject-hooks # pytest # tox tomlkit==0.12.4 # via pylint -tox==3.28.0 - # via - # -c requirements/constraints.txt - # -r requirements/dev.in +tox==4.14.2 + # via -r requirements/dev.in twine==5.0.0 # via -r requirements/quality.in typing-extensions==4.11.0 diff --git a/requirements/doc.txt b/requirements/doc.txt index 408983ac..335cab02 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -20,9 +20,11 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-zoneinfo[tzdata]==0.2.1 +backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # celery + # django # djangorestframework # kombu beautifulsoup4==4.12.3 @@ -61,9 +63,9 @@ cryptography==42.0.5 # via pyjwt ddt==1.7.2 # via -r requirements/test.in -django==3.2.25 +django==4.2.11 # via - # -c requirements/constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.in # django-crum # django-model-utils @@ -136,8 +138,10 @@ idna==3.7 # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==7.1.0 - # via sphinx +importlib-metadata==6.11.0 + # via + # -c requirements/common_constraints.txt + # sphinx iniconfig==2.0.0 # via pytest jinja2==3.1.3 @@ -214,7 +218,6 @@ pytz==2024.1 # via # -r requirements/base.in # babel - # django # event-tracking # xblock pyyaml==6.0.1 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 1471eddf..6401f544 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -8,8 +8,10 @@ build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==7.1.0 - # via build +importlib-metadata==6.11.0 + # via + # -c requirements/common_constraints.txt + # build packaging==24.0 # via build pip-tools==7.4.1 diff --git a/requirements/quality.txt b/requirements/quality.txt index b32f39b4..1d5d9540 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -18,9 +18,11 @@ attrs==23.2.0 # via openedx-events backports-tarfile==1.1.0 # via jaraco-context -backports-zoneinfo[tzdata]==0.2.1 +backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # celery + # django # djangorestframework # kombu billiard==4.2.0 @@ -67,9 +69,9 @@ ddt==1.7.2 # via -r requirements/test.in dill==0.3.8 # via pylint -django==3.2.25 +django==4.2.11 # via - # -c requirements/constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.in # django-crum # django-model-utils @@ -136,8 +138,9 @@ fs==2.4.16 # via xblock idna==3.7 # via requests -importlib-metadata==7.1.0 +importlib-metadata==6.11.0 # via + # -c requirements/common_constraints.txt # keyring # twine importlib-resources==6.4.0 @@ -258,7 +261,6 @@ python-slugify==8.0.4 pytz==2024.1 # via # -r requirements/base.in - # django # event-tracking # xblock pyyaml==6.0.1 @@ -346,4 +348,7 @@ zipp==3.18.1 # importlib-resources # The following packages are considered to be unsafe in a requirements file: -# setuptools +setuptools==69.5.1 + # via + # -r requirements/base.in + # fs diff --git a/requirements/test.txt b/requirements/test.txt index 835c0b43..1a47e69c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -12,9 +12,11 @@ asgiref==3.8.1 # via django attrs==23.2.0 # via openedx-events -backports-zoneinfo[tzdata]==0.2.1 +backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # celery + # django # djangorestframework # kombu billiard==4.2.0 @@ -52,7 +54,7 @@ cryptography==42.0.5 ddt==1.7.2 # via -r requirements/test.in # via - # -c requirements/constraints.txt + # -c requirements/common_constraints.txt # -r requirements/base.in # django-crum # django-model-utils @@ -75,6 +77,7 @@ django-waffle==4.1.0 # edx-django-utils # edx-drf-extensions # edx-toggles +djangorestframework==3.15.1 # via # -r requirements/base.in # drf-jwt @@ -176,7 +179,6 @@ python-slugify==8.0.4 pytz==2024.1 # via # -r requirements/base.in - # django # event-tracking # xblock pyyaml==6.0.1 diff --git a/setup.py b/setup.py index 017bb57a..ac6d4626 100644 --- a/setup.py +++ b/setup.py @@ -131,6 +131,7 @@ def add_version_constraint_or_raise(current_line, current_requirements, add_if_n 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', ], ) diff --git a/tox.ini b/tox.ini index e5e893cb..827fc939 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = drf{314,latest},py{38,312}-django{42} +envlist = drf{314,latest},py{38,311,312}-django{42} [doc8] max-line-length = 120 @@ -50,7 +50,6 @@ allowlist_externals = rm touch deps = - wheel -r{toxinidir}/requirements/quality.txt commands = pylint completion From a3702203396d59f406c2d7a0952938dfde7c1bcd Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Mon, 8 Apr 2024 16:36:01 +0500 Subject: [PATCH 3/6] fix: dependencies --- .github/workflows/ci.yml | 1 - Makefile | 4 ++++ requirements/test.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbbe7e75..3347c066 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: name: Tests runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: os: [ubuntu-20.04] python-version: ['3.8', '3.11', '3.12'] diff --git a/Makefile b/Makefile index 8c07546b..eada5b92 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with # Let tox control the Django version for tests sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp mv requirements/test.tmp requirements/test.txt + # Also lets tox control DRF version + sed '/^[dD]jangorestframework==/d' requirements/test.txt > requirements/test.tmp + mv requirements/test.tmp requirements/test.txt + quality: ## check coding style with pycodestyle and pylint tox -e quality diff --git a/requirements/test.txt b/requirements/test.txt index 1a47e69c..0d6069bd 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -77,7 +77,7 @@ django-waffle==4.1.0 # edx-django-utils # edx-drf-extensions # edx-toggles -djangorestframework==3.15.1 + # via # -r requirements/base.in # drf-jwt From 29b5b761422041cd4149bdea1ace224ad4d39e66 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 16 Apr 2024 11:06:15 -0400 Subject: [PATCH 4/6] build: Update codecov to use the repository upload token. This are required now and older versions of codecov fail inconsistently if they're not there. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3347c066..ded0d076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,8 @@ jobs: - name: Run Coverage if: matrix.python-version == '3.8' && matrix.toxenv=='django42-drflatest' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: flags: unittests fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} From a91cf085a0d9b7441401dc8533d2416e5024e7fc Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 16 Apr 2024 11:11:46 -0400 Subject: [PATCH 5/6] chore: Run `edx_lint update` * Also update local tweaks because one of the things we were supressing was moved to an optional extension. * Fix a pylint violation that crops up in Python 3.12 --- completion/tests/test_models.py | 2 +- pylintrc | 7 ++++--- pylintrc_tweaks | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/completion/tests/test_models.py b/completion/tests/test_models.py index 57326c24..69f292d2 100644 --- a/completion/tests/test_models.py +++ b/completion/tests/test_models.py @@ -245,7 +245,7 @@ def _create_test_completions(self, user): models.BlockCompletion.objects.submit_batch_completion( user, [ - (block, float(f"0.{randint(1,9)}")) + (block, float(f"0.{randint(1, 9)}")) for block in self.blocks + self.other_blocks ] ) diff --git a/pylintrc b/pylintrc index e3c34bc2..e64df332 100644 --- a/pylintrc +++ b/pylintrc @@ -64,7 +64,7 @@ # SERIOUSLY. # # ------------------------------ -# Generated by edx-lint version: 5.2.5 +# Generated by edx-lint version: 5.3.6 # ------------------------------ [MASTER] ignore = migrations @@ -259,6 +259,7 @@ enable = useless-suppression, disable = bad-indentation, + broad-exception-raised, consider-using-f-string, duplicate-code, file-ignored, @@ -383,6 +384,6 @@ ext-import-graph = int-import-graph = [EXCEPTIONS] -overgeneral-exceptions = Exception +overgeneral-exceptions = builtins.Exception -# c0857a3261a064e2a276a399b5ec398fd1738e0f +# 94445ea91ee8c0de6c53ae1fa510a8a063a86b78 diff --git a/pylintrc_tweaks b/pylintrc_tweaks index d344316a..9b8dba4b 100644 --- a/pylintrc_tweaks +++ b/pylintrc_tweaks @@ -5,6 +5,5 @@ load-plugins = edx_lint.pylint,pylint_django,pylint_celery [MESSAGES CONTROL] disable+ = - no-self-use, logging-format-interpolation, useless-suppression, From 4b543f11491e8cd652db509bc07cdf09c29be123 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 16 Apr 2024 11:36:25 -0400 Subject: [PATCH 6/6] chore: Add a wheel dependency for relevant quality checks. In newer versions of Python it's not installed by default. --- requirements/dev.txt | 4 +++- requirements/quality.in | 1 + requirements/quality.txt | 2 ++ requirements/test.txt | 1 - 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 7a681cd6..f09fdff6 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -403,7 +403,9 @@ web-fragments==2.2.0 webob==1.8.7 # via xblock wheel==0.43.0 - # via pip-tools + # via + # -r requirements/quality.in + # pip-tools xblock==3.1.0 # via -r requirements/base.in zipp==3.18.1 diff --git a/requirements/quality.in b/requirements/quality.in index 7c47454a..e80cccb4 100644 --- a/requirements/quality.in +++ b/requirements/quality.in @@ -9,3 +9,4 @@ isort # to standardize order of imports pycodestyle # PEP 8 compliance validation pydocstyle # PEP 257 compliance validation twine # for package description syntax validation +wheel # to make sure we can build wheels correctly. diff --git a/requirements/quality.txt b/requirements/quality.txt index 1d5d9540..52d63fae 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -340,6 +340,8 @@ web-fragments==2.2.0 # via xblock webob==1.8.7 # via xblock +wheel==0.43.0 + # via -r requirements/quality.in xblock==3.1.0 # via -r requirements/base.in zipp==3.18.1 diff --git a/requirements/test.txt b/requirements/test.txt index 0d6069bd..18293613 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -77,7 +77,6 @@ django-waffle==4.1.0 # edx-django-utils # edx-drf-extensions # edx-toggles - # via # -r requirements/base.in # drf-jwt