Skip to content

Commit f41dbf6

Browse files
committed
Drop Python 3.9 support and migrate to PEP 621
Goodbye, 3.9 Good morning, PEP 621
1 parent e20f91a commit f41dbf6

6 files changed

Lines changed: 41 additions & 102 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
name: Test with python ${{ matrix.python-version }} / ${{ matrix.os-version }}
3939
strategy:
4040
matrix:
41-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
41+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4242
os-version: ["ubuntu-latest", "windows-latest"]
4343
exclude:
4444
- os-version: windows-latest

poetry.lock

Lines changed: 4 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
1-
[tool.poetry]
1+
[project]
22
name = "pytest_httpserver"
33
version = "1.1.3"
44
description = "pytest-httpserver is a httpserver for pytest"
5-
authors = ["Zsolt Cserna <cserna.zsolt@gmail.com>"]
6-
license = "MIT"
75
readme = "README.md"
8-
documentation = "https://pytest-httpserver.readthedocs.io/en/latest/"
6+
license = "MIT"
7+
authors = [
8+
{ name = "Zsolt Cserna", email = "cserna.zsolt@gmail.com" }
9+
]
910
classifiers = [
1011
"Development Status :: 3 - Alpha",
1112
"Intended Audience :: Developers",
1213
"Operating System :: OS Independent",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
19+
"Programming Language :: Python :: 3.14",
1320
"Topic :: Software Development :: Libraries :: Python Modules",
1421
"Framework :: Pytest",
1522
]
16-
repository = "https://github.com/csernazs/pytest-httpserver"
23+
requires-python = ">=3.10"
24+
dependencies = [
25+
"Werkzeug >= 2.0.0",
26+
]
27+
28+
[project.urls]
29+
Homepage = "https://github.com/csernazs/pytest-httpserver"
30+
Documentation = "https://pytest-httpserver.readthedocs.io/en/latest/"
31+
Repository = "https://github.com/csernazs/pytest-httpserver"
32+
"Bug Tracker" = "https://github.com/csernazs/pytest-httpserver/issues"
33+
34+
[project.entry-points.pytest11]
35+
pytest_httpserver = "pytest_httpserver.pytest_plugin"
1736

37+
[tool.poetry]
1838
include = [
1939
{ path = "tests", format = "sdist" },
2040
{ path = "CHANGES.rst", format = "sdist" },
@@ -23,17 +43,6 @@ include = [
2343
{ path = "doc", format = "sdist" },
2444
]
2545

26-
[tool.poetry.dependencies]
27-
python = ">=3.9"
28-
Werkzeug = ">= 2.0.0"
29-
30-
31-
[tool.poetry.plugins.pytest11]
32-
pytest_httpserver = "pytest_httpserver.pytest_plugin"
33-
34-
[tool.poetry.urls]
35-
"Bug Tracker" = "https://github.com/csernazs/pytest-httpserver/issues"
36-
3746
[tool.poetry.group.develop]
3847
optional = true
3948

@@ -117,7 +126,6 @@ lint.ignore = [
117126
"PLR0913",
118127
"PLR2004",
119128
"PLW2901",
120-
"PT004",
121129
"PT012",
122130
"PT013",
123131
"PTH118",
@@ -138,5 +146,5 @@ lint.ignore = [
138146
"UP032",
139147
]
140148
line-length = 120
141-
target-version = "py39"
149+
target-version = "py310"
142150
exclude = ["doc", "example*.py", "tests/examples/*.py"]

pytest_httpserver/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import time
7-
from typing import Callable
7+
from collections.abc import Callable
88

99
from werkzeug import Request
1010
from werkzeug import Response

pytest_httpserver/httpserver.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import time
1010
import urllib.parse
1111
from collections import defaultdict
12+
from collections.abc import Callable
1213
from collections.abc import Generator
1314
from collections.abc import Iterable
1415
from collections.abc import Mapping
@@ -20,10 +21,7 @@
2021
from re import Pattern
2122
from typing import TYPE_CHECKING
2223
from typing import Any
23-
from typing import Callable
2424
from typing import ClassVar
25-
from typing import Optional
26-
from typing import Union
2725

2826
import werkzeug.http
2927
from werkzeug import Request
@@ -47,12 +45,9 @@
4745
URI_DEFAULT = ""
4846
METHOD_ALL = "__ALL"
4947

50-
HEADERS_T = Union[
51-
Mapping[str, Union[str, Iterable[str]]],
52-
Iterable[tuple[str, str]],
53-
]
48+
HEADERS_T = Mapping[str, str | Iterable[str]] | Iterable[tuple[str, str]]
5449

55-
HVMATCHER_T = Callable[[str, Optional[str], str], bool]
50+
HVMATCHER_T = Callable[[str, str | None, str], bool]
5651

5752

5853
class Undefined:

tests/test_release.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def build() -> Iterable[Build]:
111111

112112
@pytest.fixture(scope="session")
113113
def version(pyproject) -> str:
114-
return pyproject["tool"]["poetry"]["version"]
114+
return pyproject["project"]["version"]
115115

116116

117117
def version_to_tuple(version: str) -> tuple:
118118
return tuple([int(x) for x in version.split(".")])
119119

120120

121121
def test_no_duplicate_classifiers(build: Build, pyproject):
122-
pyproject_meta = pyproject["tool"]["poetry"]
122+
pyproject_meta = pyproject["project"]
123123
wheel_meta = build.wheel.get_meta(version=pyproject_meta["version"])
124124
classifiers = wheel_meta.get_all("Classifier")
125125
assert classifiers is not None
@@ -131,14 +131,14 @@ def test_no_duplicate_classifiers(build: Build, pyproject):
131131

132132

133133
def test_python_version(build: Build, pyproject):
134-
pyproject_meta = pyproject["tool"]["poetry"]
134+
pyproject_meta = pyproject["project"]
135135
wheel_meta = build.wheel.get_meta(version=pyproject_meta["version"])
136-
python_dependency = pyproject_meta["dependencies"]["python"]
137-
m = re.match(r">=(\d+\.\d+)", python_dependency)
136+
python_requires = pyproject_meta["requires-python"]
137+
m = re.match(r">=(\d+\.\d+)", python_requires)
138138
if m:
139139
min_version, *_ = m.groups()
140140
else:
141-
raise ValueError(python_dependency)
141+
raise ValueError(python_requires)
142142

143143
min_version_tuple = version_to_tuple(min_version)
144144

0 commit comments

Comments
 (0)