Skip to content

Commit 5f767ae

Browse files
adamtheturtledependabot[bot]claudepre-commit-ci-lite[bot]
authored
Support Python 3.14 (#2871)
* Bump sphinx from 8.2.3 to 9.1.0 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.3 to 9.1.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](sphinx-doc/sphinx@v8.2.3...v9.1.0) --- updated-dependencies: - dependency-name: sphinx dependency-version: 9.1.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump doc8 * Support Python 3.14 * Don't bump Sphinx * Fix secrets file lookup for multi-Python matrix Use modulo arithmetic to map job index to secrets file index, ensuring that adding Python versions to the matrix doesn't break the secrets file lookup. Each test pattern maps to the same secrets file regardless of Python version. The number of secrets files is determined dynamically from the extracted tarball. * Support only 3.14 * Fix ruff * Revert "Fix ruff" This reverts commit 9a342f4. * Ignore ruff TC rules until beartype supports TYPE_CHECKING Beartype requires imports to be available at runtime, not just under `if TYPE_CHECKING`. See beartype/beartype#594 for when beartype 0.23 will add support for TYPE_CHECKING imports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove runtime beartype application to test functions Python 3.14's deferred annotation evaluation (PEP 649) causes `_Stringifier.__format__` to raise a TypeError when beartype inspects function signatures at test collection time. This is a workaround until beartype 0.23 is released with full Python 3.14 support. See: - beartype/beartype#594 - beartype/beartype#440 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Drop pytest-beartype-tests due to Python 3.14 annotation issue * [pre-commit.ci lite] apply automatic fixes * Apply ruff format (PEP 758 except syntax) * Restore pytest-beartype-tests; disable plugin in repeated pytest.main calls * Ignore .claude/scheduled_tasks.lock * Add 'stringify' to spelling dict * Use real subprocess for pytest collection to avoid plugin state accumulation * Add new tests to CI matrix; exclude meta-tests from collected-once check * Restore Python 3.14 in test workflow matrix after merge * Use real subprocess in test_custom_linters to avoid beartype state accumulation * Add 'subprocess' to spelling dict * Re-apply subprocess collection: in-process approach fails on Python 3.14 full-suite runs * Bump pytest-beartype-tests to 2026.4.26; revert subprocess workaround in ci/test_custom_linters.py * Run coverage tool on Python 3.14 to parse PEP 758 except syntax * Set Python 3.14 via setup-uv python-version on coverage job * Drop comment on coverage job python-version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 39e5296 commit 5f767ae

9 files changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
build:
1919
strategy:
2020
matrix:
21-
python-version: ['3.13']
21+
python-version: ['3.14']
2222
platform: [ubuntu-latest, windows-latest]
2323
hook-stage: [pre-commit, pre-push, manual]
2424

.github/workflows/publish-site.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
with:
2323
documentation_path: docs/source
2424
pyproject_extras: dev
25-
python_version: '3.13'
25+
python_version: '3.14'
2626
sphinx_build_options: -W
2727
publish: ${{ github.ref_name == 'main' }}

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ['3.13']
29+
python-version: ['3.14']
3030
ci_pattern:
3131
- tests/mock_vws/test_query.py::TestContentType
3232
- tests/mock_vws/test_query.py::TestSuccess
@@ -191,7 +191,7 @@ jobs:
191191
runs-on: ubuntu-latest
192192
strategy:
193193
matrix:
194-
python-version: ['3.13']
194+
python-version: ['3.14']
195195
platform: [ubuntu-latest]
196196

197197
steps:
@@ -237,7 +237,7 @@ jobs:
237237
runs-on: windows-latest
238238
strategy:
239239
matrix:
240-
python-version: ['3.13']
240+
python-version: ['3.14']
241241

242242
steps:
243243
- uses: actions/checkout@v6
@@ -291,6 +291,7 @@ jobs:
291291
with:
292292
enable-cache: true
293293
cache-dependency-glob: '**/pyproject.toml'
294+
python-version: '3.14'
294295

295296
- uses: actions/download-artifact@v8
296297
with:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ This includes details on how to use the mock, options, and details of the differ
7676
:target: https://github.com/VWS-Python/vws-python-mock/actions
7777
.. |PyPI| image:: https://badge.fury.io/py/VWS-Python-Mock.svg
7878
:target: https://badge.fury.io/py/VWS-Python-Mock
79-
.. |minimum-python-version| replace:: 3.13
79+
.. |minimum-python-version| replace:: 3.14

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ license = "MIT"
2020
authors = [
2121
{ name = "Adam Dangoor", email = "adamdangoor@gmail.com" },
2222
]
23-
requires-python = ">=3.13"
23+
requires-python = ">=3.14"
2424
classifiers = [
2525
"Development Status :: 5 - Production/Stable",
2626
"Environment :: Web Environment",
2727
"Framework :: Pytest",
2828
"Operating System :: Microsoft :: Windows",
2929
"Operating System :: POSIX",
3030
"Programming Language :: Python :: 3 :: Only",
31-
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: 3.14",
3232
]
3333
dynamic = [
3434
"version",
@@ -76,7 +76,7 @@ optional-dependencies.dev = [
7676
"pyright==1.1.409",
7777
"pyroma==5.0.1",
7878
"pytest==9.0.3",
79-
"pytest-beartype-tests==2026.4.20",
79+
"pytest-beartype-tests==2026.4.26",
8080
"pytest-retry==1.7.0",
8181
"pytest-xdist==3.8.0",
8282
"pyyaml==6.0.3",
@@ -166,6 +166,12 @@ lint.ignore = [
166166
# Ignore 'too-many-*' errors as they seem to get in the way more than
167167
# helping.
168168
"PLR0913",
169+
# Beartype requires imports to be available at runtime, not just for type
170+
# checking. See https://github.com/beartype/beartype/discussions/594
171+
# for when beartype will support `if TYPE_CHECKING` imports.
172+
"TC001",
173+
"TC002",
174+
"TC003",
169175
]
170176
lint.per-file-ignores."ci/test_custom_linters.py" = [
171177
# Allow asserts in tests.
@@ -330,7 +336,7 @@ per_rule_ignores.DEP002 = [
330336
[tool.pyproject-fmt]
331337
indent = 4
332338
keep_full_version = true
333-
max_supported_python = "3.13"
339+
max_supported_python = "3.14"
334340

335341
[tool.mypy]
336342
strict = true

spelling_private_dict.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ respx
104104
rfc
105105
rgb
106106
str
107+
stringify
108+
subprocess
107109
timestamp
108110
todo
109111
travis

src/mock_vws/_flask_server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/astral-sh/uv:0.10.4-python3.13-trixie-slim AS base
1+
FROM ghcr.io/astral-sh/uv:0.11.7-python3.14-trixie-slim AS base
22
# We set this pretend version as we do not have Git in our path, and we do
33
# not care enough about having the version correct inside the Docker container
44
# to install it.

src/mock_vws/_flask_server/healthcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def flask_app_healthy(port: int) -> bool:
1515
try:
1616
conn.request(method="GET", url="/some-random-endpoint")
1717
response = conn.getresponse()
18-
except (TimeoutError, http.client.HTTPException, socket.gaierror):
18+
except TimeoutError, http.client.HTTPException, socket.gaierror:
1919
return False
2020
finally:
2121
conn.close()

src/mock_vws/target_raters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _get_brisque_target_tracking_rating(*, image_content: bytes) -> int:
4242
image_tensor = image_tensor.permute(2, 0, 1).unsqueeze(dim=0)
4343
try:
4444
brisque_score = brisque(x=image_tensor, data_range=255)
45-
except (AssertionError, IndexError):
45+
except AssertionError, IndexError:
4646
return 0
4747
return math.ceil(int(brisque_score.item()) / 20)
4848

0 commit comments

Comments
 (0)