From 6ddea4725620bb8b707ef5fa1b3e0e37f6583564 Mon Sep 17 00:00:00 2001 From: John Kurkowski Date: Mon, 4 Nov 2024 15:17:57 -0800 Subject: [PATCH 1/2] Remove Python 3.9 port Python 3.9 is now the minimum supported version, so `is_relative_to` is available. --- tests/test_parallel.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 6ae10dfd..8d16d76c 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -44,22 +44,10 @@ def test_cache_cleared_by_other_process( extract("google.com") orig_unlink = os.unlink - def is_relative_to(path: Path, other_path: str | Path) -> bool: - """Return True if path is relative to other_path or False. - - Taken from the Python 3.9 standard library. - Reference: https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.is_relative_to - """ - try: - path.relative_to(other_path) - return True - except ValueError: - return False - def evil_unlink(filename: str | Path) -> None: """Simulate someone deletes the file right before we try to.""" if (isinstance(filename, str) and filename.startswith(cache_dir)) or ( - isinstance(filename, Path) and is_relative_to(filename, cache_dir) + isinstance(filename, Path) and filename.is_relative_to(cache_dir) ): orig_unlink(filename) orig_unlink(filename) From c48336093361d87d7bdfa1398b6a44407c048f12 Mon Sep 17 00:00:00 2001 From: John Kurkowski Date: Mon, 4 Nov 2024 15:11:56 -0800 Subject: [PATCH 2/2] Support Python 3.13 --- .github/workflows/ci.yml | 1 + pyproject.toml | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f20c2719..db2b5e80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: {python-version: "3.10", toxenv: "py310"}, {python-version: "3.11", toxenv: "py311"}, {python-version: "3.12", toxenv: "py312"}, + {python-version: "3.13", toxenv: "py313"}, {python-version: "pypy3.9", toxenv: "pypy39"}, {python-version: "pypy3.10", toxenv: "pypy310"}, ] diff --git a/pyproject.toml b/pyproject.toml index 6ec12ed5..1a07d661 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] requires-python = ">=3.9" dynamic = ["version"] diff --git a/tox.ini b/tox.ini index 4d80a7a4..9ebfbf35 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{39,310,311,312,py39,py310},codestyle,lint,typecheck +envlist = py{39,310,311,312,313,py39,py310},codestyle,lint,typecheck [testenv] commands = pytest {posargs}