From 20d2b690c772c555f263fdfd593afdcf034af1cc Mon Sep 17 00:00:00 2001 From: edX requirements bot Date: Fri, 23 Feb 2024 07:37:46 -0500 Subject: [PATCH 1/3] feat: add python 3.12 support --- .github/workflows/ci.yml | 8 +++++--- requirements/base.txt | 6 ++++-- requirements/ci.txt | 2 +- requirements/constraints.txt | 3 +++ requirements/dev.txt | 9 +++++---- requirements/doc.txt | 5 +++-- requirements/pip-tools.txt | 7 +------ requirements/quality.txt | 3 ++- requirements/test.txt | 3 ++- tox.ini | 27 ++++++++++++++------------- 10 files changed, 40 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8fc968..5695777 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,10 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [quality, docs, django32, django42] + python-version: + - '3.8' + - '3.12' + toxenv: [quality, docs, django42] steps: - uses: actions/checkout@v4 - name: setup python @@ -39,4 +41,4 @@ jobs: uses: codecov/codecov-action@v3 with: flags: unittests - fail_ci_if_error: true + fail_ci_if_error: false diff --git a/requirements/base.txt b/requirements/base.txt index c0b4661..f902be3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,8 +6,10 @@ # asgiref==3.8.1 # via django -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django django==4.2.11 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt diff --git a/requirements/ci.txt b/requirements/ci.txt index c9dd749..c085cbc 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -12,7 +12,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.13.3 # via # tox # virtualenv diff --git a/requirements/constraints.txt b/requirements/constraints.txt index d91704b..2d27179 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -10,3 +10,6 @@ # Common constraints for edx repos -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + +# For python greater than or equal to 3.9 backports.zoneinfo is causing failures +backports.zoneinfo;python_version<"3.9" diff --git a/requirements/dev.txt b/requirements/dev.txt index c040252..758a734 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -13,11 +13,12 @@ astroid==3.1.0 # -r requirements/quality.txt # pylint # pylint-celery -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/quality.txt # django -build==1.1.1 +build==1.2.1 # via # -r requirements/pip-tools.txt # pip-tools @@ -77,7 +78,7 @@ exceptiongroup==1.2.0 # via # -r requirements/quality.txt # pytest -filelock==3.13.1 +filelock==3.13.3 # via # -r requirements/ci.txt # tox @@ -100,7 +101,7 @@ jinja2==3.1.3 # -r requirements/quality.txt # code-annotations # diff-cover -lxml==5.1.0 +lxml==5.2.0 # via edx-i18n-tools markupsafe==2.1.5 # via diff --git a/requirements/doc.txt b/requirements/doc.txt index 97916e5..23788b7 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -16,8 +16,9 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django beautifulsoup4==4.12.3 @@ -63,7 +64,7 @@ jinja2==3.1.3 # via sphinx markupsafe==2.1.5 # via jinja2 -nh3==0.2.15 +nh3==0.2.17 # via readme-renderer packaging==24.0 # via diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index aad9d38..a065a69 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,15 +4,10 @@ # # make upgrade # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.11.0 - # via - # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt - # build -packaging==24.0 # via build pip-tools==7.4.1 # via -r requirements/pip-tools.in diff --git a/requirements/quality.txt b/requirements/quality.txt index 007a603..1d0ddfc 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -12,8 +12,9 @@ astroid==3.1.0 # via # pylint # pylint-celery -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django click==8.1.7 diff --git a/requirements/test.txt b/requirements/test.txt index e769e43..e58f62d 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -8,8 +8,9 @@ asgiref==3.8.1 # via # -r requirements/base.txt # django -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/base.txt # django coverage[toml]==7.4.4 diff --git a/tox.ini b/tox.ini index 5894f0c..ede6e82 100644 --- a/tox.ini +++ b/tox.ini @@ -1,25 +1,26 @@ [tox] -envlist = py38-django{32,42}, quality, docs +envlist = py{38, 312}-django{42}, quality, docs [testenv] -deps = - django32: Django>=3.2,<4.0 +deps = django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt -commands = +commands = python -Wd -m pytest {posargs} [testenv:docs] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = {toxinidir} -allowlist_externals = +allowlist_externals = make rm -deps = +deps = -r{toxinidir}/requirements/doc.txt twine -commands = + setuptools + wheel +commands = doc8 --ignore-path docs/_build README.rst docs rm -f docs/xss_utils.rst rm -f docs/modules.rst @@ -29,16 +30,17 @@ commands = twine check dist/* [testenv:quality] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = {toxinidir} -allowlist_externals = +allowlist_externals = make rm touch -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = + setuptools +commands = touch tests/__init__.py pylint xss_utils tests tests_utils manage.py setup.py rm tests/__init__.py @@ -46,4 +48,3 @@ commands = pydocstyle xss_utils tests manage.py setup.py isort --check-only --diff tests test_utils xss_utils manage.py setup.py test_settings.py make selfcheck - From d88660103497b8b7ad46b0e417939b4b2ae5f2f0 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 22 Apr 2024 12:33:23 -0400 Subject: [PATCH 2/3] build: Add python 3.11 testing and update codecov action. Test on 3.11 as well since that's what we'll be shipping for edx-platform for Redwood. Also update the codecov github action and use the new repo secret to upload coverage reports to make the uploads less flaky. --- .github/workflows/ci.yml | 4 +++- tox.ini | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5695777..584865f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: os: [ubuntu-20.04] python-version: - '3.8' + - '3.11' - '3.12' toxenv: [quality, docs, django42] steps: @@ -38,7 +39,8 @@ jobs: - name: Run coverage if: matrix.python-version == '3.8' && matrix.toxenv == 'django42' - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: flags: unittests fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tox.ini b/tox.ini index ede6e82..5c3b93c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38, 312}-django{42}, quality, docs +envlist = py{38, 311, 312}-django{42}, quality, docs [testenv] deps = From ab369e020992e4833d170703624c7f708984fe83 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 22 Apr 2024 12:38:18 -0400 Subject: [PATCH 3/3] docs: Versin bump, classifier and changelog update. --- CHANGELOG.rst | 9 +++++++-- setup.py | 5 +++-- xss_utils/__init__.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 59b7a78..640f683 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,7 @@ Change Log in this file. It adheres to the structure of http://keepachangelog.com/ , but in reStructuredText instead of Markdown (for ease of incorporation into Sphinx documentation and the PyPI description). - + This project adheres to Semantic Versioning (http://semver.org/). .. There should always be an "Unreleased" section for changes pending release. @@ -14,6 +14,11 @@ Change Log Unreleased ~~~~~~~~~~ +[0.6.0] - 2024-04-22 +~~~~~~~~~~~~~~~~~~~~ + +* Test and declare Python 3.11 and 3.12 compatibility. + [0.5.0] - 2023-08-01 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -21,7 +26,7 @@ Unreleased deprecated. See https://github.com/openedx/edx-sphinx-theme/issues/184 for more details. * Added supportt for Django 4.2 - + [0.4.0] - 2022-01-20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/setup.py b/setup.py index 7709345..08edab9 100644 --- a/setup.py +++ b/setup.py @@ -122,12 +122,13 @@ def is_requirement(line): 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.11', + 'Programming Language :: Python :: 3.12', ], ) diff --git a/xss_utils/__init__.py b/xss_utils/__init__.py index 4f9065c..af342e3 100644 --- a/xss_utils/__init__.py +++ b/xss_utils/__init__.py @@ -1,4 +1,4 @@ """ Utilities to prevent possible XSS attacks on Django/Mako templates.. """ -__version__ = '0.5.1' +__version__ = '0.6.0'