diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dff0fc74..7813fd84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,22 +18,22 @@ jobs: name: "Python ${{ matrix.python-version }} / ${{ matrix.os }}" runs-on: "${{ matrix.os }}" env: - USING_COVERAGE: "3.8,3.9,3.10,3.11,3.12" + USING_COVERAGE: "3.10,3.11,3.12,3.13,3.14" strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: - - "3.8" - - "3.9" - "3.10" - "3.11" - "3.12" - - "pypy3.9" + - "3.13" + - "3.14" + - "pypy3.11" exclude: - os: macos-latest - python-version: pypy3.9 + python-version: pypy3.11 steps: - uses: actions/checkout@v4 diff --git a/.readthedocs.yml b/.readthedocs.yml index 345a389a..763c1045 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,7 +5,7 @@ build: os: ubuntu-22.04 tools: # Keep version in sync with tox.ini (docs and gh-actions). - python: "3.12" + python: "3.14" sphinx: configuration: doc/conf.py diff --git a/changelog.d/272.misc.rst b/changelog.d/272.misc.rst new file mode 100644 index 00000000..c800f1da --- /dev/null +++ b/changelog.d/272.misc.rst @@ -0,0 +1 @@ +Update Python version support to 3.10-3.14 and PyPy 3.11. Drop Python 3.8/3.9 support. diff --git a/pyproject.toml b/pyproject.toml index 7d46e849..ef0c117d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" name = "PyHamcrest" description = "Hamcrest framework for matcher objects" readme = "README.rst" -requires-python = ">= 3.8" +requires-python = ">= 3.10" license = "BSD-3-Clause" license-files = ["LICENSE.txt"] keywords = [ @@ -31,11 +31,11 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "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", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: Jython", "Programming Language :: Python :: Implementation :: PyPy", @@ -46,7 +46,7 @@ classifiers = [ dynamic = ["version"] [project.optional-dependencies] -docs = ["sphinx~=5.0", "alabaster~=0.7"] +docs = ["sphinx~=7.0", "alabaster~=0.7"] tests = [ "pytest>=5.0", "pytest-sugar", diff --git a/src/hamcrest/core/core/future.py b/src/hamcrest/core/core/future.py index b58bc2a8..05995c30 100644 --- a/src/hamcrest/core/core/future.py +++ b/src/hamcrest/core/core/future.py @@ -1,4 +1,3 @@ -import sys import re import asyncio from typing import ( @@ -19,14 +18,8 @@ T = TypeVar("T") -if sys.version_info > (3, 9): - # Same as used in typeshed for asyncio.ensure_future - FutureT = asyncio.Future[T] - FutureLike = Union[asyncio.Future[T], Awaitable[T]] -else: - # Future is not a parametrised type in earlier version of python - FutureT = asyncio.Future - FutureLike = Union[asyncio.Future, Awaitable] +FutureT = asyncio.Future[T] +FutureLike = Union[asyncio.Future[T], Awaitable[T]] class FutureRaising(BaseMatcher[asyncio.Future]): diff --git a/tox.ini b/tox.ini index c5d9d39a..1181d684 100644 --- a/tox.ini +++ b/tox.ini @@ -13,16 +13,16 @@ looponfailroots = # Keep docs in sync with docs env and .readthedocs.yml. [gh] python = - 3.8 = py38, py38-numpy - 3.9 = py39, py39-numpy 3.10 = py310, py310-numpy 3.11 = py311, py311-numpy - 3.12 = py312, py312-numpy, lint, changelog, typing, docs - pypy3.9 = pypy3 + 3.12 = py312, py312-numpy + 3.13 = py313, py313-numpy + 3.14 = py314, py314-numpy, lint, changelog, typing, docs + pypy3.11 = pypy3 [tox] -envlist = typing,lint,py38{,-numpy},py39{,-numpy},py310{,-numpy},py311{,-numpy},py312{,-numpy},pypy{,-numpy},pypy3{,-numpy},docs,pypi-description,changelog,coverage-report +envlist = typing,lint,py310{,-numpy},py311{,-numpy},py312{,-numpy},py313{,-numpy},py314{,-numpy},pypy{,-numpy},pypy3{,-numpy},docs,pypi-description,changelog,coverage-report isolated_build = True @@ -35,75 +35,75 @@ extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = python -m pytest {posargs} -[testenv:py38-numpy] +[testenv:py310-numpy] extras = tests-numpy commands = python -m pytest {posargs} -[testenv:py39-numpy] +[testenv:py311-numpy] extras = tests-numpy commands = python -m pytest {posargs} -[testenv:py310-numpy] +[testenv:py312-numpy] extras = tests-numpy commands = python -m pytest {posargs} -[testenv:py311-numpy] +[testenv:py313-numpy] extras = tests-numpy commands = python -m pytest {posargs} -[testenv:py312-numpy] +[testenv:py314-numpy] extras = tests-numpy commands = python -m pytest {posargs} -[testenv:py38] +[testenv:py310] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. -basepython = python3.8 +basepython = python3.10 setenv = PYTHONWARNINGS=d extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = coverage run -m pytest {posargs} -[testenv:py39] +[testenv:py311] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. -basepython = python3.9 +basepython = python3.11 setenv = PYTHONWARNINGS=d extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = coverage run -m pytest {posargs} -[testenv:py310] +[testenv:py312] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. -basepython = python3.10 +basepython = python3.12 setenv = PYTHONWARNINGS=d extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = coverage run -m pytest {posargs} -[testenv:py311] +[testenv:py313] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. -basepython = python3.11 +basepython = python3.13 setenv = PYTHONWARNINGS=d extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = coverage run -m pytest {posargs} -[testenv:py312] +[testenv:py314] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. -basepython = python3.12 +basepython = python3.14 setenv = PYTHONWARNINGS=d extras = {env:TOX_AP_TEST_EXTRAS:tests} @@ -111,7 +111,7 @@ commands = coverage run -m pytest {posargs} [testenv:coverage-report] -basepython = python3.12 +basepython = python3.14 skip_install = true deps = coverage[toml]>=5.0.2 commands = @@ -120,7 +120,7 @@ commands = [testenv:lint] -basepython = python3.12 +basepython = python3.14 skip_install = true deps = pre-commit @@ -131,14 +131,14 @@ commands = [testenv:docs] # Keep basepython in sync with gh-actions and .readthedocs.yml. -basepython = python3.12 +basepython = python3.14 extras = docs commands = sphinx-build -n -T -b html -d {envtmpdir}/doctrees doc doc/_build/html [testenv:pypi-description] -basepython = python3.12 +basepython = python3.14 skip_install = true deps = twine @@ -149,7 +149,7 @@ commands = [testenv:changelog] -basepython = python3.12 +basepython = python3.14 deps = towncrier skip_install = true @@ -157,7 +157,7 @@ commands = towncrier --draft [testenv:typing] -basepython = python3.12 +basepython = python3.14 deps = mypy <= 1.10.1 types-mock