Skip to content

Commit 731df26

Browse files
brunnsclaude
andcommitted
Update Python version support to 3.10-3.14
Drop support for Python 3.8 and 3.9, add support for Python 3.13 and 3.14. Update PyPy from 3.9 to 3.11 to align with supported versions. Changes: - Update minimum Python requirement from 3.8 to 3.10 in pyproject.toml - Update Python version classifiers (remove 3.8/3.9, add 3.13/3.14) - Upgrade Sphinx from ~=5.0 to ~=7.0 for Python 3.13+ compatibility (Python 3.13 removed the imghdr module used by Sphinx 5.x) - Update CI matrix to test Python 3.10-3.14 and PyPy 3.11 - Update tox environments: add py313/py314, remove py38/py39 - Update development tools (lint, typing, docs) to use Python 3.14 - Simplify future.py type annotations by removing Python 3.9 compatibility code All tests, linting, type checking, and documentation builds pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ab5ceb3 commit 731df26

5 files changed

Lines changed: 38 additions & 45 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ jobs:
1818
name: "Python ${{ matrix.python-version }} / ${{ matrix.os }}"
1919
runs-on: "${{ matrix.os }}"
2020
env:
21-
USING_COVERAGE: "3.8,3.9,3.10,3.11,3.12"
21+
USING_COVERAGE: "3.10,3.11,3.12,3.13,3.14"
2222

2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
os: [ubuntu-latest, macos-latest, windows-latest]
2727
python-version:
28-
- "3.8"
29-
- "3.9"
3028
- "3.10"
3129
- "3.11"
3230
- "3.12"
33-
- "pypy3.9"
31+
- "3.13"
32+
- "3.14"
33+
- "pypy3.11"
3434
exclude:
3535
- os: macos-latest
36-
python-version: pypy3.9
36+
python-version: pypy3.11
3737

3838
steps:
3939
- uses: actions/checkout@v4

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55
os: ubuntu-22.04
66
tools:
77
# Keep version in sync with tox.ini (docs and gh-actions).
8-
python: "3.12"
8+
python: "3.14"
99

1010
sphinx:
1111
configuration: doc/conf.py

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "PyHamcrest"
77
description = "Hamcrest framework for matcher objects"
88
readme = "README.rst"
9-
requires-python = ">= 3.8"
9+
requires-python = ">= 3.10"
1010
license = "BSD-3-Clause"
1111
license-files = ["LICENSE.txt"]
1212
keywords = [
@@ -31,11 +31,11 @@ classifiers = [
3131
"Natural Language :: English",
3232
"Operating System :: OS Independent",
3333
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.8",
35-
"Programming Language :: Python :: 3.9",
3634
"Programming Language :: Python :: 3.10",
3735
"Programming Language :: Python :: 3.11",
3836
"Programming Language :: Python :: 3.12",
37+
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
3939
"Programming Language :: Python :: Implementation :: CPython",
4040
"Programming Language :: Python :: Implementation :: Jython",
4141
"Programming Language :: Python :: Implementation :: PyPy",
@@ -46,7 +46,7 @@ classifiers = [
4646
dynamic = ["version"]
4747

4848
[project.optional-dependencies]
49-
docs = ["sphinx~=5.0", "alabaster~=0.7"]
49+
docs = ["sphinx~=7.0", "alabaster~=0.7"]
5050
tests = [
5151
"pytest>=5.0",
5252
"pytest-sugar",

src/hamcrest/core/core/future.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import re
32
import asyncio
43
from typing import (
@@ -19,14 +18,8 @@
1918

2019
T = TypeVar("T")
2120

22-
if sys.version_info > (3, 9):
23-
# Same as used in typeshed for asyncio.ensure_future
24-
FutureT = asyncio.Future[T]
25-
FutureLike = Union[asyncio.Future[T], Awaitable[T]]
26-
else:
27-
# Future is not a parametrised type in earlier version of python
28-
FutureT = asyncio.Future
29-
FutureLike = Union[asyncio.Future, Awaitable]
21+
FutureT = asyncio.Future[T]
22+
FutureLike = Union[asyncio.Future[T], Awaitable[T]]
3023

3124

3225
class FutureRaising(BaseMatcher[asyncio.Future]):

tox.ini

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ looponfailroots =
1313
# Keep docs in sync with docs env and .readthedocs.yml.
1414
[gh]
1515
python =
16-
3.8 = py38, py38-numpy
17-
3.9 = py39, py39-numpy
1816
3.10 = py310, py310-numpy
1917
3.11 = py311, py311-numpy
20-
3.12 = py312, py312-numpy, lint, changelog, typing, docs
21-
pypy3.9 = pypy3
18+
3.12 = py312, py312-numpy
19+
3.13 = py313, py313-numpy
20+
3.14 = py314, py314-numpy, lint, changelog, typing, docs
21+
pypy3.11 = pypy3
2222

2323

2424
[tox]
25-
envlist = typing,lint,py38{,-numpy},py39{,-numpy},py310{,-numpy},py311{,-numpy},py312{,-numpy},pypy{,-numpy},pypy3{,-numpy},docs,pypi-description,changelog,coverage-report
25+
envlist = typing,lint,py310{,-numpy},py311{,-numpy},py312{,-numpy},py313{,-numpy},py314{,-numpy},pypy{,-numpy},pypy3{,-numpy},docs,pypi-description,changelog,coverage-report
2626
isolated_build = True
2727

2828

@@ -35,83 +35,83 @@ extras = {env:TOX_AP_TEST_EXTRAS:tests}
3535
commands = python -m pytest {posargs}
3636

3737

38-
[testenv:py38-numpy]
38+
[testenv:py310-numpy]
3939
extras = tests-numpy
4040
commands = python -m pytest {posargs}
4141

4242

43-
[testenv:py39-numpy]
43+
[testenv:py311-numpy]
4444
extras = tests-numpy
4545
commands = python -m pytest {posargs}
4646

4747

48-
[testenv:py310-numpy]
48+
[testenv:py312-numpy]
4949
extras = tests-numpy
5050
commands = python -m pytest {posargs}
5151

5252

53-
[testenv:py311-numpy]
53+
[testenv:py313-numpy]
5454
extras = tests-numpy
5555
commands = python -m pytest {posargs}
5656

5757

58-
[testenv:py312-numpy]
58+
[testenv:py314-numpy]
5959
extras = tests-numpy
6060
commands = python -m pytest {posargs}
6161

6262

63-
[testenv:py38]
63+
[testenv:py310]
6464
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
6565
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
66-
basepython = python3.8
66+
basepython = python3.10
6767
setenv =
6868
PYTHONWARNINGS=d
6969
extras = {env:TOX_AP_TEST_EXTRAS:tests}
7070
commands = coverage run -m pytest {posargs}
7171

7272

73-
[testenv:py39]
73+
[testenv:py311]
7474
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
7575
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
76-
basepython = python3.9
76+
basepython = python3.11
7777
setenv =
7878
PYTHONWARNINGS=d
7979
extras = {env:TOX_AP_TEST_EXTRAS:tests}
8080
commands = coverage run -m pytest {posargs}
8181

8282

83-
[testenv:py310]
83+
[testenv:py312]
8484
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
8585
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
86-
basepython = python3.10
86+
basepython = python3.12
8787
setenv =
8888
PYTHONWARNINGS=d
8989
extras = {env:TOX_AP_TEST_EXTRAS:tests}
9090
commands = coverage run -m pytest {posargs}
9191

9292

93-
[testenv:py311]
93+
[testenv:py313]
9494
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
9595
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
96-
basepython = python3.11
96+
basepython = python3.13
9797
setenv =
9898
PYTHONWARNINGS=d
9999
extras = {env:TOX_AP_TEST_EXTRAS:tests}
100100
commands = coverage run -m pytest {posargs}
101101

102102

103-
[testenv:py312]
103+
[testenv:py314]
104104
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
105105
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
106-
basepython = python3.12
106+
basepython = python3.14
107107
setenv =
108108
PYTHONWARNINGS=d
109109
extras = {env:TOX_AP_TEST_EXTRAS:tests}
110110
commands = coverage run -m pytest {posargs}
111111

112112

113113
[testenv:coverage-report]
114-
basepython = python3.12
114+
basepython = python3.14
115115
skip_install = true
116116
deps = coverage[toml]>=5.0.2
117117
commands =
@@ -120,7 +120,7 @@ commands =
120120

121121

122122
[testenv:lint]
123-
basepython = python3.12
123+
basepython = python3.14
124124
skip_install = true
125125
deps =
126126
pre-commit
@@ -131,14 +131,14 @@ commands =
131131

132132
[testenv:docs]
133133
# Keep basepython in sync with gh-actions and .readthedocs.yml.
134-
basepython = python3.12
134+
basepython = python3.14
135135
extras = docs
136136
commands =
137137
sphinx-build -n -T -b html -d {envtmpdir}/doctrees doc doc/_build/html
138138

139139

140140
[testenv:pypi-description]
141-
basepython = python3.12
141+
basepython = python3.14
142142
skip_install = true
143143
deps =
144144
twine
@@ -149,15 +149,15 @@ commands =
149149

150150

151151
[testenv:changelog]
152-
basepython = python3.12
152+
basepython = python3.14
153153
deps =
154154
towncrier
155155
skip_install = true
156156
commands = towncrier --draft
157157

158158

159159
[testenv:typing]
160-
basepython = python3.12
160+
basepython = python3.14
161161
deps =
162162
mypy <= 1.10.1
163163
types-mock

0 commit comments

Comments
 (0)