From 7bf1bd2d459988db1ffa7a5c8e1a1d5d51c31033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 8 Oct 2025 10:50:26 -0700 Subject: [PATCH] Add 3.14 support and drop 3.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/check.yaml | 9 ++++----- .github/workflows/release.yaml | 2 +- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 34 +++++++++++++++++----------------- src/filelock/asyncio.py | 3 ++- tests/test_filelock.py | 6 +++--- tox.toml | 6 +++--- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index f686331..260aaf0 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -26,7 +26,6 @@ jobs: - "3.12" - "3.11" - "3.10" - - "3.9" - "pypy3.11" os: - ubuntu-24.04 @@ -42,7 +41,7 @@ jobs: - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v7 - name: "🧪 Install tox" - run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv - name: "🐍 Install Python" run: uv python install --python-preference only-managed ${{ matrix.py }} - name: "⚙️ Setup test suite" @@ -87,9 +86,9 @@ jobs: - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v7 - name: "🧪 Install tox" - run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv - name: "📦 Build package to generate version" - run: uv build --python 3.13 --python-preference only-managed --wheel . --out-dir dist + run: uv build --python 3.14 --python-preference only-managed --wheel . --out-dir dist - name: "⚙️ Setup coverage tool" run: tox -e coverage --notest env: @@ -133,7 +132,7 @@ jobs: - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v7 - name: "🧪 Install tox" - run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv - name: "⚙️ Setup test suite" run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} env: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4f4f35c..9275d8e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ jobs: - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v7 - name: "📦 Build package" - run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist + run: uv build --python 3.14 --python-preference only-managed --sdist --wheel . --out-dir dist - name: "📤 Store the distribution packages" uses: actions/upload-artifact@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afc0bcb..ce13a49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,18 +15,18 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.2.1"] - repo: https://github.com/tox-dev/tox-toml-fmt - rev: "v1.0.0" + rev: "v1.1.0" hooks: - id: tox-toml-fmt - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.7.0" + rev: "v2.8.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.13.3" + rev: "v0.14.0" hooks: - id: ruff-format - - id: ruff + - id: ruff-check args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier rev: "v3.6.2" # Use the sha / tag you want to point at diff --git a/pyproject.toml b/pyproject.toml index 251a228..7b09dd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ license = "Unlicense" maintainers = [ { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }, ] -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -28,11 +28,11 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Internet", "Topic :: Software Development :: Libraries", "Topic :: System", @@ -57,36 +57,36 @@ dev = [ test = [ "covdefaults>=2.3", - "diff-cover>=9.6", - "pytest>=8.4.1", - "pytest-asyncio>=1.1", - "pytest-cov>=6.2.1", - "pytest-mock>=3.14.1", + "diff-cover>=9.7.1", + "pytest>=8.4.2", + "pytest-asyncio>=1.2", + "pytest-cov>=7", + "pytest-mock>=3.15.1", "pytest-timeout>=2.4", - "virtualenv>=20.33.1", + "virtualenv>=20.34", ] type = [ - "mypy>=1.17.1", - "typing-extensions>=4.14.1; python_version<'3.11'", + "mypy>=1.18.2", + "typing-extensions>=4.15; python_version<'3.11'", { include-group = "test" }, ] docs = [ - "furo>=2025.7.19", + "furo>=2025.9.25", "sphinx>=8.2.3", "sphinx-autodoc-typehints>=3.2", ] fix = [ - "pre-commit-uv>=4.1.4", + "pre-commit-uv>=4.1.5", ] pkg-meta = [ "check-wheel-contents>=0.6.3", - "twine>=6.1", - "uv>=0.8.5", + "twine>=6.2", + "uv>=0.8.22", ] coverage = [ "covdefaults>=2.3", - "coverage[toml]>=7.10.2", - "diff-cover>=9.6", + "coverage[toml]>=7.10.7", + "diff-cover>=9.7.1", ] [tool.hatch] @@ -140,7 +140,7 @@ quiet-level = 3 ignore-words-list = "master" [tool.pyproject-fmt] -max_supported_python = "3.13" +max_supported_python = "3.14" [tool.pytest.ini_options] asyncio_default_fixture_loop_scope = "session" diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index 22ae122..022d0ef 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -10,7 +10,7 @@ from dataclasses import dataclass from inspect import iscoroutinefunction from threading import local -from typing import TYPE_CHECKING, Any, Callable, NoReturn, cast +from typing import TYPE_CHECKING, Any, NoReturn, cast from ._api import BaseFileLock, FileLockContext, FileLockMeta from ._error import Timeout @@ -20,6 +20,7 @@ if TYPE_CHECKING: import sys + from collections.abc import Callable from concurrent import futures from types import TracebackType diff --git a/tests/test_filelock.py b/tests/test_filelock.py index 91f7682..ab9e405 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -12,7 +12,7 @@ from pathlib import Path, PurePath from stat import S_IWGRP, S_IWOTH, S_IWUSR, filemode from types import TracebackType -from typing import TYPE_CHECKING, Any, Callable, Union +from typing import TYPE_CHECKING, Any from uuid import uuid4 from weakref import WeakValueDictionary @@ -21,7 +21,7 @@ from filelock import BaseFileLock, FileLock, SoftFileLock, Timeout, UnixFileLock, WindowsFileLock if TYPE_CHECKING: - from collections.abc import Iterator + from collections.abc import Callable, Iterator from pytest_mock import MockerFixture @@ -220,7 +220,7 @@ def test_nested_contruct(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_1.is_locked -_ExcInfoType = Union[tuple[type[BaseException], BaseException, TracebackType], tuple[None, None, None]] +_ExcInfoType = tuple[type[BaseException], BaseException, TracebackType] | tuple[None, None, None] class ExThread(threading.Thread): diff --git a/tox.toml b/tox.toml index ad5d3a3..b687472 100644 --- a/tox.toml +++ b/tox.toml @@ -1,5 +1,5 @@ -requires = [ "tox>=4.28.4" ] -env_list = [ "fix", "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "coverage", "type", "docs", "pkg_meta" ] +requires = [ "tox>=4.30.2" ] +env_list = [ "fix", "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "coverage", "type", "docs", "pkg_meta" ] skip_missing_interpreters = true [env_run_base] @@ -71,7 +71,7 @@ commands = [ ], ] parallel_show_output = true -depends = [ "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9" ] +depends = [ "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10" ] [env.fix] description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"