diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9f90bc..0863a34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: name: Test with python ${{ matrix.python-version }} / ${{ matrix.os-version }} strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] os-version: ["ubuntu-latest", "windows-latest"] exclude: - os-version: windows-latest diff --git a/poetry.lock b/poetry.lock index a9900b3..7a9db23 100644 --- a/poetry.lock +++ b/poetry.lock @@ -205,22 +205,6 @@ files = [ {file = "charset_normalizer-3.4.2.tar.gz", hash = "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63"}, ] -[[package]] -name = "click" -version = "8.1.8" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.7" -groups = ["develop"] -markers = "python_version < \"3.11\"" -files = [ - {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, - {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - [[package]] name = "click" version = "8.2.1" @@ -228,7 +212,6 @@ description = "Composable command line interface toolkit" optional = false python-versions = ">=3.10" groups = ["develop"] -markers = "python_version >= \"3.11\"" files = [ {file = "click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b"}, {file = "click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202"}, @@ -449,7 +432,7 @@ description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["develop", "test"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, @@ -520,31 +503,6 @@ files = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] -[[package]] -name = "importlib-metadata" -version = "8.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.9" -groups = ["develop", "doc"] -markers = "python_version == \"3.9\"" -files = [ - {file = "importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd"}, - {file = "importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000"}, -] - -[package.dependencies] -zipp = ">=3.20" - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] -type = ["pytest-mypy"] - [[package]] name = "iniconfig" version = "2.1.0" @@ -1171,7 +1129,6 @@ babel = ">=2.13" colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} docutils = ">=0.20,<0.22" imagesize = ">=1.3" -importlib-metadata = {version = ">=6.0", markers = "python_version < \"3.10\""} Jinja2 = ">=3.1" packaging = ">=23.0" Pygments = ">=2.17" @@ -1332,7 +1289,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["develop", "doc", "test"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, @@ -1462,28 +1419,7 @@ markupsafe = ">=2.1.1" [package.extras] watchdog = ["watchdog (>=2.3)"] -[[package]] -name = "zipp" -version = "3.23.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.9" -groups = ["develop", "doc"] -markers = "python_version == \"3.9\"" -files = [ - {file = "zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e"}, - {file = "zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166"}, -] - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more_itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] -type = ["pytest-mypy"] - [metadata] lock-version = "2.1" -python-versions = ">=3.9" -content-hash = "20492e635a0a2507cd0bd41bf60a5c293171cbb5b94db18d733b75018669a1d4" +python-versions = ">=3.10" +content-hash = "804da365ac2c28bcf74254944c3f92a2b4e6632640b9f2762faf6fe3dfef1382" diff --git a/pyproject.toml b/pyproject.toml index 6628f63..10da44d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,40 @@ -[tool.poetry] +[project] name = "pytest_httpserver" version = "1.1.3" description = "pytest-httpserver is a httpserver for pytest" -authors = ["Zsolt Cserna "] -license = "MIT" readme = "README.md" -documentation = "https://pytest-httpserver.readthedocs.io/en/latest/" +license = "MIT" +authors = [ + { name = "Zsolt Cserna", email = "cserna.zsolt@gmail.com" } +] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "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", "Topic :: Software Development :: Libraries :: Python Modules", "Framework :: Pytest", ] -repository = "https://github.com/csernazs/pytest-httpserver" +requires-python = ">=3.10" +dependencies = [ + "Werkzeug >= 2.0.0", +] + +[project.urls] +Homepage = "https://github.com/csernazs/pytest-httpserver" +Documentation = "https://pytest-httpserver.readthedocs.io/en/latest/" +Repository = "https://github.com/csernazs/pytest-httpserver" +"Bug Tracker" = "https://github.com/csernazs/pytest-httpserver/issues" + +[project.entry-points.pytest11] +pytest_httpserver = "pytest_httpserver.pytest_plugin" +[tool.poetry] include = [ { path = "tests", format = "sdist" }, { path = "CHANGES.rst", format = "sdist" }, @@ -23,17 +43,6 @@ include = [ { path = "doc", format = "sdist" }, ] -[tool.poetry.dependencies] -python = ">=3.9" -Werkzeug = ">= 2.0.0" - - -[tool.poetry.plugins.pytest11] -pytest_httpserver = "pytest_httpserver.pytest_plugin" - -[tool.poetry.urls] -"Bug Tracker" = "https://github.com/csernazs/pytest-httpserver/issues" - [tool.poetry.group.develop] optional = true @@ -117,7 +126,6 @@ lint.ignore = [ "PLR0913", "PLR2004", "PLW2901", - "PT004", "PT012", "PT013", "PTH118", @@ -138,5 +146,5 @@ lint.ignore = [ "UP032", ] line-length = 120 -target-version = "py39" +target-version = "py310" exclude = ["doc", "example*.py", "tests/examples/*.py"] diff --git a/pytest_httpserver/hooks.py b/pytest_httpserver/hooks.py index e995a6b..1d0d547 100644 --- a/pytest_httpserver/hooks.py +++ b/pytest_httpserver/hooks.py @@ -4,7 +4,7 @@ import os import time -from typing import Callable +from collections.abc import Callable from werkzeug import Request from werkzeug import Response diff --git a/pytest_httpserver/httpserver.py b/pytest_httpserver/httpserver.py index cbcaaf2..5e7f09d 100644 --- a/pytest_httpserver/httpserver.py +++ b/pytest_httpserver/httpserver.py @@ -9,6 +9,7 @@ import time import urllib.parse from collections import defaultdict +from collections.abc import Callable from collections.abc import Generator from collections.abc import Iterable from collections.abc import Mapping @@ -20,10 +21,7 @@ from re import Pattern from typing import TYPE_CHECKING from typing import Any -from typing import Callable from typing import ClassVar -from typing import Optional -from typing import Union import werkzeug.http from werkzeug import Request @@ -47,12 +45,9 @@ URI_DEFAULT = "" METHOD_ALL = "__ALL" -HEADERS_T = Union[ - Mapping[str, Union[str, Iterable[str]]], - Iterable[tuple[str, str]], -] +HEADERS_T = Mapping[str, str | Iterable[str]] | Iterable[tuple[str, str]] -HVMATCHER_T = Callable[[str, Optional[str], str], bool] +HVMATCHER_T = Callable[[str, str | None, str], bool] class Undefined: diff --git a/tests/test_release.py b/tests/test_release.py index bc39907..5c3dbfd 100644 --- a/tests/test_release.py +++ b/tests/test_release.py @@ -111,7 +111,7 @@ def build() -> Iterable[Build]: @pytest.fixture(scope="session") def version(pyproject) -> str: - return pyproject["tool"]["poetry"]["version"] + return pyproject["project"]["version"] def version_to_tuple(version: str) -> tuple: @@ -119,7 +119,7 @@ def version_to_tuple(version: str) -> tuple: def test_no_duplicate_classifiers(build: Build, pyproject): - pyproject_meta = pyproject["tool"]["poetry"] + pyproject_meta = pyproject["project"] wheel_meta = build.wheel.get_meta(version=pyproject_meta["version"]) classifiers = wheel_meta.get_all("Classifier") assert classifiers is not None @@ -131,14 +131,14 @@ def test_no_duplicate_classifiers(build: Build, pyproject): def test_python_version(build: Build, pyproject): - pyproject_meta = pyproject["tool"]["poetry"] + pyproject_meta = pyproject["project"] wheel_meta = build.wheel.get_meta(version=pyproject_meta["version"]) - python_dependency = pyproject_meta["dependencies"]["python"] - m = re.match(r">=(\d+\.\d+)", python_dependency) + python_requires = pyproject_meta["requires-python"] + m = re.match(r">=(\d+\.\d+)", python_requires) if m: min_version, *_ = m.groups() else: - raise ValueError(python_dependency) + raise ValueError(python_requires) min_version_tuple = version_to_tuple(min_version)