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

Support Python 3.13 #341

Merged
merged 2 commits into from
Nov 4, 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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
]
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
14 changes: 1 addition & 13 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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}
Expand Down