Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
72 changes: 4 additions & 68 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 26 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <cserna.zsolt@gmail.com>"]
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" },
Expand All @@ -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

Expand Down Expand Up @@ -117,7 +126,6 @@ lint.ignore = [
"PLR0913",
"PLR2004",
"PLW2901",
"PT004",
"PT012",
"PT013",
"PTH118",
Expand All @@ -138,5 +146,5 @@ lint.ignore = [
"UP032",
]
line-length = 120
target-version = "py39"
target-version = "py310"
exclude = ["doc", "example*.py", "tests/examples/*.py"]
2 changes: 1 addition & 1 deletion pytest_httpserver/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions pytest_httpserver/httpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ 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:
return tuple([int(x) for x in version.split(".")])


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
Expand All @@ -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)

Expand Down