From b7ae5b3e08c6a3cc92c761f9e678ffacdd7dc93a Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Tue, 1 Oct 2024 20:55:35 +0200 Subject: [PATCH] Add support for Python 3.13. (#369) --- .github/workflows/main.yml | 3 ++- CHANGELOG.md | 1 + setup.py | 1 + tests/__init__.py | 5 ++++- tox.ini | 10 +++++----- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d2a1d119..812f811a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code @@ -26,6 +26,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install dependencies run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 03509bd7..d62b1398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 2.13 (unreleased) +* Add support for Python 3.13 (Jendrik Seipp, #369). * Add PyPI and conda-forge badges to README file (Trevor James Smith, #356). * Include `tests/**/*.toml` in sdist (Colin Watson). diff --git a/setup.py b/setup.py index d9187eac..e9a453f8 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ def find_version(*parts): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Quality Assurance", diff --git a/tests/__init__.py b/tests/__init__.py index 58e1da85..c54b3877 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -8,7 +8,10 @@ REPO = pathlib.Path(__file__).resolve().parents[1] WHITELISTS = [ - str(path) for path in (REPO / "vulture" / "whitelists").glob("*.py") + str(path) + for path in (REPO / "vulture" / "whitelists").glob("*.py") + # Pint is incompatible with Python 3.13 (https://github.com/hgrecco/pint/issues/1969). + if sys.version_info < (3, 13) or path.name != "pint_whitelist.py" ] diff --git a/tox.ini b/tox.ini index 4ca649a9..3d363561 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,20 @@ [tox] -envlist = cleanup, py{38,310,311,312}, style # Skip py39 since it chokes on distutils. +envlist = cleanup, py{38,310,311,312,313}, style # Skip py39 since it chokes on distutils. skip_missing_interpreters = true # Erase old coverage results, then accumulate them during this tox run. [testenv:cleanup] deps = - coverage==7.0.5 + coverage commands = coverage erase [testenv] deps = - coverage==7.0.5 + coverage pint # Use latest version to catch API changes. - pytest==7.4.2 - pytest-cov==4.0.0 + pytest + pytest-cov commands = pytest {posargs} # Install package as wheel in all envs (https://hynek.me/articles/turbo-charge-tox/).