Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add python 3.11 and 3.12 support #216

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, docs, django32, django42]
python-version:
- '3.8'
- '3.11'
- '3.12'
toxenv: [quality, docs, django42]
steps:
- uses: actions/checkout@v4
- name: setup python
Expand All @@ -36,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: true
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 7 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ 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.

Unreleased
~~~~~~~~~~

[0.6.0] - 2024-04-22
~~~~~~~~~~~~~~~~~~~~

* Test and declare Python 3.11 and 3.12 compatibility.

[0.5.0] - 2023-08-01
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 4 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 5 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
)
27 changes: 14 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[tox]
envlist = py38-django{32,42}, quality, docs
envlist = py{38, 311, 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
Expand All @@ -29,21 +30,21 @@ 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
pycodestyle xss_utils tests manage.py setup.py
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

2 changes: 1 addition & 1 deletion xss_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Utilities to prevent possible XSS attacks on Django/Mako templates..
"""
__version__ = '0.5.1'
__version__ = '0.6.0'