[project]
name = "pypi-tea"
version = "0.2.4"
description = "TEA Server for PyPI Package SBOMs"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.14"
dependencies = [
    "cyclonedx-python-lib[json-validation]>=11.6.0",
    "fastapi>=0.115",
    "httpx>=0.27",
    "libtea>=0.4.0",
    "packageurl-python>=0.15",
    "pydantic-settings>=2.13.1",
    "redis[hiredis]>=5.0",
    "remotezip>=0.12",
    "sentry-sdk[fastapi]>=2.0",
    "spdx-tools>=0.8.3",
    "uvicorn[standard]>=0.30",
]

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

[tool.hatch.build.targets.wheel]
packages = ["src/pypi_tea"]
sbom-files = ["pypi-tea.cdx.json"]

[tool.hatch.build.targets.sdist]
include = ["src/pypi_tea", "pypi-tea.cdx.json", "pyproject.toml", "README.md", "LICENSE"]

[dependency-groups]
dev = [
    "fakeredis[lua]>=2.20",
    "mypy>=1.19.1",
    "pytest>=9.0.2",
    "ruff>=0.15.4",
    "types-requests>=2.32.4.20260107",
]

[tool.ruff]
target-version = "py314"
line-length = 120
src = ["src", "tests"]

[tool.ruff.lint]
select = [
    "E",     # pycodestyle errors
    "W",     # pycodestyle warnings
    "F",     # pyflakes
    "I",     # isort
    "UP",    # pyupgrade
    "B",     # flake8-bugbear
    "SIM",   # flake8-simplify
    "RUF",   # ruff-specific
]
ignore = [
    "B008",  # Depends() in function defaults is the FastAPI pattern
]

[tool.ruff.lint.isort]
known-first-party = ["pypi_tea"]

[tool.mypy]
python_version = "3.14"
strict = true
warn_return_any = true
warn_unused_configs = true
plugins = ["pydantic.mypy"]
disallow_untyped_decorators = false

[[tool.mypy.overrides]]
module = ["remotezip", "sentry_sdk"]
ignore_missing_imports = true
