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

[project]
name = "pythonfeatures"
dynamic = ["version"]
description = "Standard python interface to orchard features."
readme = "README.md"
license = "MIT"
authors = [{ name = "The Orchard", email = "webdev@theorchard.com" }]
requires-python = ">=3.11"
dependencies = [
    "owsrequest~=4.0.0",
    "secrets_manager~=1.4",
    "splitio_client[cpphash]~=10.1",
]
classifiers = [
    "Programming Language :: Python :: 3.9",
    "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",
]

[project.urls]
Homepage = "https://github.com/theorchard/python-orchard-features"

[dependency-groups]
dev = [
    "ruff~=0.14",
    "pytest==9.1.0",
    "pytest-cov==4.1.0",
    "pytest-mock==3.12.0",
    "bump2version~=1.0",
]

[tool.hatch.version]
path = "pythonfeatures/__version__.py"

[tool.hatch.build.targets.wheel]
packages = ["pythonfeatures"]

[tool.hatch.build.targets.sdist]
include = ["pythonfeatures"]

# `.split` is a fallback Splits file loaded at runtime relative to the package
# directory (see pythonfeatures/config.py). hatchling drops dotfiles from the
# build by default, so force them into both the wheel and sdist.
[tool.hatch.build.targets.wheel.force-include]
"pythonfeatures/constants/.split" = "pythonfeatures/constants/.split"

[tool.hatch.build.targets.sdist.force-include]
"pythonfeatures/constants/.split" = "pythonfeatures/constants/.split"

[tool.pytest.ini_options]
addopts = "-vv"
testpaths = ["tests"]

# Replaces the old flake8 stack (flake8 + flake8-docstrings/builtins/quotes/
# import-order). Mirrors the prior config: 100-char lines, google import order,
# single quotes, docstring + builtin-shadowing checks.
[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "W", "F", "I", "D", "A", "Q"]

[tool.ruff.lint.isort]
known-first-party = ["pythonfeatures", "tests"]
force-single-line = true
force-sort-within-sections = true

[tool.ruff.lint.pydocstyle]
convention = "pep257"

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"

[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D"]

# Private Orchard package index (was the index_url in setup.cfg). Set as the
# default index so it fully replaces upstream PyPI, matching prior behavior.
[[tool.uv.index]]
url = "https://pypi.theorchard.io/pypi/"
default = true
