Skip to content
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions changelog.d/272.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Python version support to 3.10-3.14 and PyPy 3.11. Drop Python 3.8/3.9 support.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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",
Expand All @@ -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",
Expand Down
11 changes: 2 additions & 9 deletions src/hamcrest/core/core/future.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import re
import asyncio
from typing import (
Expand All @@ -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]):
Expand Down
52 changes: 26 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -35,83 +35,83 @@ 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}
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 =
Expand All @@ -120,7 +120,7 @@ commands =


[testenv:lint]
basepython = python3.12
basepython = python3.14
skip_install = true
deps =
pre-commit
Expand All @@ -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
Expand All @@ -149,15 +149,15 @@ commands =


[testenv:changelog]
basepython = python3.12
basepython = python3.14
deps =
towncrier
skip_install = true
commands = towncrier --draft


[testenv:typing]
basepython = python3.12
basepython = python3.14
deps =
mypy <= 1.10.1
types-mock
Expand Down
Loading