From d8d775371cedc06fa184b75b950578816254dee9 Mon Sep 17 00:00:00 2001 From: Mathias Ertl Date: Sun, 1 Dec 2024 10:49:11 +0100 Subject: [PATCH] add support for Python 3.13, announce deprecation for Django 5.0 --- .github/workflows/docs.yml | 2 +- .github/workflows/faketime.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/quality.yml | 2 +- .github/workflows/tests.yml | 2 +- Dockerfile | 2 +- ca/django_ca/tests/api/test_utils.py | 2 +- ca/django_ca/tests/pydantic/test_extensions.py | 4 ++-- ca/django_ca/tests/pydantic/test_general_name.py | 2 +- ca/django_ca/tests/pydantic/test_name.py | 2 +- ca/django_ca/tests/pydantic/test_validators.py | 2 +- ca/django_ca/tests/test_docs.py | 6 +++--- ca/django_ca/tests/test_profiles.py | 4 ++-- ca/django_ca/tests/test_utils.py | 2 +- docs/source/changelog/TBR_2.1.0.rst | 10 +++++++++- docs/source/deprecation.rst | 5 +++++ pyproject.toml | 3 ++- tox.ini | 12 ++++++------ 18 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e6ce59352..9d531ed22 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.12" + python-version: "3.13" architecture: x64 - name: Apply caching of dependencies diff --git a/.github/workflows/faketime.yml b/.github/workflows/faketime.yml index 78e64aa86..0f5a8ea8a 100644 --- a/.github/workflows/faketime.yml +++ b/.github/workflows/faketime.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.12" + python-version: "3.13" architecture: x64 - name: Apply caching of dependencies diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 8cfd74e9c..33d32052f 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.12" + python-version: "3.13" architecture: x64 - name: Apply caching of dependencies diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 9b5af7171..11cc78106 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5.0.0 with: - python-version: "3.12" + python-version: "3.13" architecture: x64 - name: Apply caching of dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2fe6a759f..73fcc5369 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] django-version: [ "4.2.0", "5.0.0", "5.1.0" ] cryptography-version: [ "43.0", "44.0" ] pydantic-version: [ "2.9.0", "2.10.0" ] diff --git a/Dockerfile b/Dockerfile index 5c9794e83..98530bf2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:1.10.0 # https://hub.docker.com/r/docker/dockerfile # https://docs.docker.com/build/dockerfile/release-notes/ -ARG IMAGE=python:3.12-alpine3.20 +ARG IMAGE=python:3.13-alpine3.20 FROM $IMAGE as base WORKDIR /usr/src/django-ca diff --git a/ca/django_ca/tests/api/test_utils.py b/ca/django_ca/tests/api/test_utils.py index 9c5f97bd3..4ac0a9154 100644 --- a/ca/django_ca/tests/api/test_utils.py +++ b/ca/django_ca/tests/api/test_utils.py @@ -24,7 +24,7 @@ @pytest.mark.django_db def test_doctests() -> None: """Test doctests in the module.""" - failures, _tests = doctest.testmod(utils) + failures, *_tests = doctest.testmod(utils) assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/pydantic/test_extensions.py b/ca/django_ca/tests/pydantic/test_extensions.py index 042feae86..c6642998c 100644 --- a/ca/django_ca/tests/pydantic/test_extensions.py +++ b/ca/django_ca/tests/pydantic/test_extensions.py @@ -145,13 +145,13 @@ def assert_extension_model( def test_doctests() -> None: """Load doctests.""" - failures, _tests = doctest_module("django_ca.pydantic.extensions") + failures, *_tests = doctest_module("django_ca.pydantic.extensions") assert failures == 0, f"{failures} doctests failed, see above for output." def test_doctest_extension_attributes() -> None: """Load doctests.""" - failures, _tests = doctest_module("django_ca.pydantic.extension_attributes") + failures, *_tests = doctest_module("django_ca.pydantic.extension_attributes") assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/pydantic/test_general_name.py b/ca/django_ca/tests/pydantic/test_general_name.py index c285de8f5..c1cf9537e 100644 --- a/ca/django_ca/tests/pydantic/test_general_name.py +++ b/ca/django_ca/tests/pydantic/test_general_name.py @@ -36,7 +36,7 @@ def test_doctests() -> None: """Load doctests.""" - failures, _tests = doctest_module("django_ca.pydantic.general_name") + failures, *_tests = doctest_module("django_ca.pydantic.general_name") assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/pydantic/test_name.py b/ca/django_ca/tests/pydantic/test_name.py index c50db0102..28d569e61 100644 --- a/ca/django_ca/tests/pydantic/test_name.py +++ b/ca/django_ca/tests/pydantic/test_name.py @@ -28,7 +28,7 @@ def test_doctests() -> None: """Run doctests for this module.""" - failures, _tests = doctest_module("django_ca.pydantic.name") + failures, *_tests = doctest_module("django_ca.pydantic.name") assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/pydantic/test_validators.py b/ca/django_ca/tests/pydantic/test_validators.py index 653d1ee74..cba77a90c 100644 --- a/ca/django_ca/tests/pydantic/test_validators.py +++ b/ca/django_ca/tests/pydantic/test_validators.py @@ -21,7 +21,7 @@ def test_doctests() -> None: """Load doctests.""" - failures, _tests = doctest_module("django_ca.pydantic.validators") + failures, *_tests = doctest_module("django_ca.pydantic.validators") assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/test_docs.py b/ca/django_ca/tests/test_docs.py index fe828d299..ab6808572 100644 --- a/ca/django_ca/tests/test_docs.py +++ b/ca/django_ca/tests/test_docs.py @@ -44,17 +44,17 @@ def globs(usable_root: CertificateAuthority, root_cert: Certificate) -> dict[str def test_python_intro(globs: dict[str, Any]) -> None: """Test python/intro.rst.""" - failures, _tests = doctest.testfile(os.path.join(BASE, "python", "intro.rst"), globs=globs) + failures, *_tests = doctest.testfile(os.path.join(BASE, "python", "intro.rst"), globs=globs) assert failures == 0, f"{failures} doctests failed, see above for output." def test_python_models(globs: dict[str, Any]) -> None: """Test python/models.rst.""" - failures, _tests = doctest.testfile(os.path.join(BASE, "python", "models.rst"), globs=globs) + failures, *_tests = doctest.testfile(os.path.join(BASE, "python", "models.rst"), globs=globs) assert failures == 0, f"{failures} doctests failed, see above for output." def test_python_pydantic_models(globs: dict[str, Any]) -> None: """Test python/models.rst.""" - failures, _tests = doctest.testfile(os.path.join(BASE, "python", "pydantic.rst"), globs=globs) + failures, *_tests = doctest.testfile(os.path.join(BASE, "python", "pydantic.rst"), globs=globs) assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/test_profiles.py b/ca/django_ca/tests/test_profiles.py index 15e78fa7c..00c6126ab 100644 --- a/ca/django_ca/tests/test_profiles.py +++ b/ca/django_ca/tests/test_profiles.py @@ -83,13 +83,13 @@ def create_cert( def test_doctests_module(doctest_globs: dict[str, Any]) -> None: # pylint: disable=redefined-outer-name """Run doctests for this module.""" - failures, _tests = doctest_module("django_ca.profiles", globs=doctest_globs) + failures, *_tests = doctest_module("django_ca.profiles", globs=doctest_globs) assert failures == 0, f"{failures} doctests failed, see above for output." def test_doctest_documentation(doctest_globs: dict[str, Any]) -> None: # pylint: disable=redefined-outer-name """Test python/profiles.rst.""" - failures, _tests = doctest.testfile("../../../docs/source/python/profiles.rst", globs=doctest_globs) + failures, *_tests = doctest.testfile("../../../docs/source/python/profiles.rst", globs=doctest_globs) assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/ca/django_ca/tests/test_utils.py b/ca/django_ca/tests/test_utils.py index 632cb32f7..c55407d68 100644 --- a/ca/django_ca/tests/test_utils.py +++ b/ca/django_ca/tests/test_utils.py @@ -61,7 +61,7 @@ def test_doctests() -> None: """Load doctests.""" - failures, _tests = doctest_module("django_ca.utils") + failures, *_tests = doctest_module("django_ca.utils") assert failures == 0, f"{failures} doctests failed, see above for output." diff --git a/docs/source/changelog/TBR_2.1.0.rst b/docs/source/changelog/TBR_2.1.0.rst index b8b88019a..5f5f78826 100644 --- a/docs/source/changelog/TBR_2.1.0.rst +++ b/docs/source/changelog/TBR_2.1.0.rst @@ -35,7 +35,7 @@ Settings Dependencies ************ -* Add support for ``cryptography~=44.0`` and ``pydantic~=2.10.0``. +* Add support for Python 3.13, ``cryptography~=44.0`` and ``pydantic~=2.10.0``. * **BACKWARDS INCOMPATIBLE:** Dropped support for ``pydantic~=2.7.0``, ``pydantic~=2.8.0``, ``cryptography~=42.0`` and ``acme~=2.10.0``. @@ -83,3 +83,11 @@ Views * The `scope` parameter is deprecated and will be removed in django-ca 2.3.0. Use `only_contains_ca_certs` and `only_contains_user_certs` instead. * The `include_issuing_distribution_point` no longer has any effect and will be removed in django-ca 2.3.0. + +******************* +Deprecation notices +******************* + +Please also see the :doc:`deprecation timeline ` for previous deprecation notices. + +* This will be the last release to support ``django~=5.0.0``. \ No newline at end of file diff --git a/docs/source/deprecation.rst b/docs/source/deprecation.rst index 81c7587a6..97f1e1211 100644 --- a/docs/source/deprecation.rst +++ b/docs/source/deprecation.rst @@ -66,6 +66,11 @@ Python API * ``django_ca.utils.get_storage()`` will be removed (deprecated since 2.0). +Dependencies +============ + +* Support ``django~=5.0.0`` will be dropped. + *********** 2.1.0 (TBR) *********** diff --git a/pyproject.toml b/pyproject.toml index 342176914..9a8d6deb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [django-ca.release] # https://devguide.python.org/versions/#versions -python = ["3.9", "3.10", "3.11", "3.12"] +python = ["3.9", "3.10", "3.11", "3.12", "3.13"] # https://www.djangoproject.com/download/ django = ["4.2", "5.0", "5.1"] cryptography = ["43", "44"] @@ -96,6 +96,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Topic :: Security :: Cryptography", "Topic :: Security", diff --git a/tox.ini b/tox.ini index ed5db3fae..41f925224 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = pylint,docs,lint,mypy,demo,dist-test - py{310,311,312}-dj{5.0,5.1}-cg{43,44}-acme{2.11}-pydantic{2.9,2.10} - py{39,310,311,312}-dj{4.2}-cg{43,44}-acme{2.11}-pydantic{2.9,2.10} + py{310,311,312,313}-dj{5.0,5.1}-cg{43,44}-acme{2.11}-pydantic{2.9,2.10} + py{39,310,311,312,313}-dj{4.2}-cg{43,44}-acme{2.11}-pydantic{2.9,2.10} faketime [testenv] @@ -34,7 +34,7 @@ commands = faketime -f "+100y" pytest -v --no-selenium --basetemp="{env_tmp_dir}" --cov-report html:{envdir}/htmlcov/ --durations=20 {posargs} [testenv:demo] -basepython = python3 +basepython = python3.13 skipsdist = True deps = -r requirements.txt @@ -45,7 +45,7 @@ commands = python dev.py init-demo [testenv:lint] -basepython = python3 +basepython = python3.13 skipsdist = True deps = -r requirements.txt @@ -65,7 +65,7 @@ commands = pylint ca/ca/ ca/django_ca/ docs/source/django_ca_sphinx/ devscripts/ dev.py [testenv:docs] -basepython = python3.12 +basepython = python3.13 skipsdist = True allowlist_externals = make deps = @@ -76,7 +76,7 @@ commands = make -C docs clean spelling html [testenv:mypy] -basepython = python3 +basepython = python3.13 skipsdist = True deps = -r requirements.txt