[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "pook"
dynamic = ["version"]
description = "HTTP traffic mocking and expectations made easy"
readme = "README.rst"
license = "MIT"
authors = [
    { name = "Tomas Aparicio", email = "tomas@aparicio.me" },
    { name = "Sara Marcondes", email = "git@sarayourfriend.pictures" },
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Developers",
    "Intended Audience :: System Administrators",
    "License :: OSI Approved :: MIT License",
    "Natural Language :: English",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: Implementation :: CPython",
    "Programming Language :: Python :: Implementation :: PyPy",
    "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",
    "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
    "furl>=0.5.6",
    "jsonschema>=2.5.1",
    "xmltodict>=0.11.0",
]
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/h2non/pook"

[project.entry-points.pytest11]
pook = "pook.pytest_fixture"

[tool.hatch.version]
path = "src/pook/__init__.py"

[tool.hatch.build.targets.sdist]
packages = ["src/pook"]

[tool.hatch.build.targets.wheel]
packages = ["src/pook"]

[tool.hatch.envs.default]
python = "3.14"
dependencies = [
    "pre-commit~=4.0",
    "mypy>=1.11.2",

    "pytest~=8.3",
    "pytest-asyncio~=1.3.0",
    "pytest-pook==0.1.0b0",

    "falcon~=4.0",

    "requests~=2.20",
    "urllib3~=2.2",
    "httpx~=0.26",

    "aiohttp~=3.10",
    "async-timeout~=4.0",

    # mocket relies on httptools which does not support PyPy
    "mocket[pook]~=3.12.2; platform_python_implementation != 'PyPy'",
]

[tool.hatch.envs.default.scripts]
ci = [
    "lint-install",
    "lint",
    "test",
]
test = "pytest {args}"

lint-install = "pre-commit install"
lint = "pre-commit run --all-files"
types = "mypy --install-types --non-interactive src/pook/interceptors {args}"

[tool.hatch.envs.docs]
extra-dependencies = [
    "sphinx==8.1.3",
    "sphinx-autobuild==2024.10.3",
    "sphinx-rtd-theme==3.0.1",
]

[tool.hatch.envs.docs.scripts]
preview = "sphinx-autobuild docs docs/_build/html {args}"
build = "sphinx-build -b html docs docs/_build/html {args}"

[tool.hatch.envs.test]
[[tool.hatch.envs.test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.11"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
