diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3403cf19..d01218fd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,7 +5,7 @@ on: tags: ['v*'] # push events to matching v*, i.e. v1.0, v20.15.10 env: - PYTHON_DEFAULT_VERSION: "3.12" + PYTHON_DEFAULT_VERSION: "3.14" UV_VERSION: "0.8.24" jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7f06f35..c1a123d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: branches: [master] env: - PYTHON_DEFAULT_VERSION: "3.12" + PYTHON_DEFAULT_VERSION: "3.14" UV_VERSION: "0.8.24" jobs: @@ -99,7 +99,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10"] extras: [ "" ] exclude: - os: "macos-latest" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69785988..3bfa480e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ In order to make it easier to contribute, core developers of this project: * maintain Continuous Integration (by using GitHub Actions) that: * runs all sorts of linters * checks if the Python distribution can be built - * runs all tests on a matrix of 6 versions of Python (including pypy) and 3 operating systems + * runs all tests on a matrix of 8 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows) * checks if the documentation can be built properly * maintain other Continuous Integration tools (coverage tracker) @@ -63,7 +63,7 @@ With `nox`, you can run different sessions (default are `lint` and `test`): * `format` -> Format the code. * `lint` -> Run linters. -* `test` (`test-3.7`, `test-3.8`, `test-3.9`, `test-3.10`) -> Run test suite. +* `test` (`test-3.9`, `test-3.10`, `test-3.11`, `test-3.12`, `test-3.13`, `test-3.14`, `test-pypy3.9`, `test-pypy3.10`) -> Run test suite. * `cover` -> Perform coverage analysis. * `build` -> Build the distribution. * `doc` -> Build the documentation. @@ -73,7 +73,7 @@ For example: $ nox -s format nox > Running session format - nox > Creating virtual environment (virtualenv) using python3.10 in .nox/format + nox > Creating virtual environment (virtualenv) using python3.14 in .nox/format ... $ nox -s format @@ -85,15 +85,15 @@ For example: nox > Running session format ... -Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.7-3.10 by default. +Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.9-3.14 (+ pypy3.9 and pypy3.10) by default. -Sessions other than `test` use the last given Python version, 3.10 by default. +Sessions other than `test` use the last CPython version from `NOX_PYTHONS`, 3.14 by default. You can change it: - export NOX_PYTHONS=3.7,3.8 + export NOX_PYTHONS=3.12,3.14 -With the above setting, session `test` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8. +With the above setting, session `test` will run on Python 3.12 and 3.14, and all other sessions on Python 3.14. Given Python interpreters should be installed in the operating system or via [pyenv](https://github.com/pyenv/pyenv). diff --git a/changelog.d/+python314.added.md b/changelog.d/+python314.added.md new file mode 100644 index 00000000..736a3e43 --- /dev/null +++ b/changelog.d/+python314.added.md @@ -0,0 +1 @@ +Declare official support for Python 3.14 and include it in the CI test matrix. diff --git a/doc/source/conf.py b/doc/source/conf.py index 3329cf45..7c8a742c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -210,4 +210,6 @@ ] # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/': None} +intersphinx_mapping = {'python': ('https://docs.python.org/', None)} + +coverage_statistics_to_report = False diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 8337aab6..8a0ee347 100644 --- a/doc/source/contributing.rst +++ b/doc/source/contributing.rst @@ -20,20 +20,20 @@ We encourage outside contributors to perform changes on our codebase. Many such * runs all sorts of linters * checks if the Python distribution can be built - * runs all tests on a matrix of 6 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows) + * runs all tests on a matrix of 8 versions of Python (including pypy) and 3 operating systems (Linux, Mac OS X and Windows) * checks if the documentation can be built properly * maintain other Continuous Integration tools (coverage tracker) -You'll need to have `nox `_ installed: +You'll need to have `nox `_ and `uv `_ installed: -* ``pip install nox`` +* ``pip install nox uv`` With ``nox``, you can run different sessions (default are ``lint`` and ``test``): * ``format`` -> Format the code. * ``lint`` -> Run linters. -* ``test`` (``test-3.7``, ``test-3.8``, ``test-3.9``, ``test-3.10``) -> Run test suite. +* ``test`` (``test-3.9``, ``test-3.10``, ``test-3.11``, ``test-3.12``, ``test-3.13``, ``test-3.14``, ``test-pypy3.9``, ``test-pypy3.10``) -> Run test suite. * ``cover`` -> Perform coverage analysis. * ``build`` -> Build the distribution. * ``deploy`` -> Deploy the distribution to the PyPi. @@ -44,7 +44,7 @@ For example:: $ nox -s format nox > Running session format - nox > Creating virtual environment (virtualenv) using python3.10 in .nox/format + nox > Creating virtual environment (virtualenv) using python3.14 in .nox/format ... $ nox -s format @@ -56,15 +56,15 @@ For example:: nox > Running session format ... -Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.7-3.10 by default. +Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.9-3.14 (+ pypy3.9 and pypy3.10) by default. -Sessions other than ``test`` use the last given Python version, 3.10 by default. +Sessions other than ``test`` use the last CPython version from ``NOX_PYTHONS``, 3.14 by default. You can change it:: - export NOX_PYTHONS=3.7,3.8 + export NOX_PYTHONS=3.12,3.14 -With the above setting, session ``test`` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8. +With the above setting, session ``test`` will run on Python 3.12 and 3.14, and all other sessions on Python 3.14. Given Python interpreters should be installed in the operating system or via `pyenv `_. diff --git a/noxfile.py b/noxfile.py index 87c0c922..2f3af379 100644 --- a/noxfile.py +++ b/noxfile.py @@ -33,6 +33,7 @@ '3.11', '3.12', '3.13', + '3.14', ] if NOX_PYTHONS is None else NOX_PYTHONS.split(',') @@ -52,12 +53,15 @@ def _detect_python_nox_id() -> str: PYTHON_VERSIONS = [_detect_python_nox_id()] print(f'CI job mode; using provided interpreter only; PYTHON_VERSIONS={PYTHON_VERSIONS!r}') -PYTHON_DEFAULT_VERSION = PYTHON_VERSIONS[-2] if len(PYTHON_VERSIONS) > 1 else PYTHON_VERSIONS[0] +PYTHON_DEFAULT_VERSION = next( + (version for version in reversed(PYTHON_VERSIONS) if not version.lower().startswith('pypy')), + PYTHON_VERSIONS[-1], +) PY_PATHS = ['b2sdk', 'test', 'noxfile.py'] nox.options.default_venv_backend = 'uv' -nox.options.reuse_existing_virtualenvs = False +nox.options.reuse_existing_virtualenvs = True nox.options.sessions = [ 'lint', 'test', @@ -225,8 +229,8 @@ def doc_cover(session): session.run('cat', report_file, external=True) with open('build/coverage/python.txt') as fd: - # If there is no undocumented files, the report should have only 2 lines (header) - if sum(1 for _ in fd) != 2: + # If there is no undocumented files, the report should have only 3 lines (header) + if sum(1 for _ in fd) != 3: session.error('sphinx coverage has failed') diff --git a/pyproject.toml b/pyproject.toml index f2e385c0..8ad37b50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ "annotated_types>=0.5.0", @@ -71,7 +72,7 @@ release = [ ] doc = [ "sadisplay>=0.4.9", - "sphinx>=5.3.0, <6", + "sphinx>=7.4.7, <8", "sphinx-autobuild>=2021.3.14", "sphinx-rtd-theme>=2.0.0", "sphinx-autodoc-typehints>=1.23.0", diff --git a/uv.lock b/uv.lock index 273f0dc4..cfeebb25 100644 --- a/uv.lock +++ b/uv.lock @@ -136,7 +136,7 @@ provides-extras = ["full"] [package.metadata.requires-dev] doc = [ { name = "sadisplay", specifier = ">=0.4.9" }, - { name = "sphinx", specifier = ">=5.3.0,<6" }, + { name = "sphinx", specifier = ">=7.4.7,<8" }, { name = "sphinx-autobuild", specifier = ">=2021.3.14" }, { name = "sphinx-autodoc-typehints", specifier = ">=1.23.0" }, { name = "sphinx-rtd-theme", specifier = ">=2.0.0" }, @@ -599,11 +599,11 @@ wheels = [ [[package]] name = "docutils" -version = "0.19" +version = "0.20.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6b/5c/330ea8d383eb2ce973df34d1239b3b21e91cd8c865d21ff82902d952f91f/docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6", size = 2056383, upload-time = "2022-07-05T20:17:31.045Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1f/53/a5da4f2c5739cf66290fac1431ee52aff6851c7c8ffd8264f13affd7bcdd/docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b", size = 2058365, upload-time = "2023-05-16T23:39:19.748Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/93/69/e391bd51bc08ed9141ecd899a0ddb61ab6465309f1eb470905c0c8868081/docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc", size = 570472, upload-time = "2022-07-05T20:17:26.388Z" }, + { url = "https://files.pythonhosted.org/packages/26/87/f238c0670b94533ac0353a4e2a1a771a0cc73277b88bff23d3ae35a256c1/docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6", size = 572666, upload-time = "2023-05-16T23:39:15.976Z" }, ] [[package]] @@ -1549,7 +1549,7 @@ wheels = [ [[package]] name = "sphinx" -version = "5.3.0" +version = "7.4.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "alabaster" }, @@ -1569,10 +1569,11 @@ dependencies = [ { name = "sphinxcontrib-jsmath" }, { name = "sphinxcontrib-qthelp" }, { name = "sphinxcontrib-serializinghtml" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/af/b2/02a43597980903483fe5eb081ee8e0ba2bb62ea43a70499484343795f3bf/Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5", size = 6811365, upload-time = "2022-10-16T09:58:25.963Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5b/be/50e50cb4f2eff47df05673d361095cafd95521d2a22521b920c67a372dcb/sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe", size = 8067911, upload-time = "2024-07-20T14:46:56.059Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/67/a7/01dd6fd9653c056258d65032aa09a615b5d7b07dd840845a9f41a8860fbc/sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d", size = 3183160, upload-time = "2022-10-16T09:58:21.63Z" }, + { url = "https://files.pythonhosted.org/packages/0d/ef/153f6803c5d5f8917dbb7f7fcf6d34a871ede3296fa89c2c703f5f8a6c8e/sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239", size = 3401624, upload-time = "2024-07-20T14:46:52.142Z" }, ] [[package]]