[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "tipsharks"
version = "0.1.0"
description = "TipSharks - Advanced harness racing ratings and predictions"
requires-python = ">=3.12"
dependencies = [
    "fastapi>=0.109.0",
    "uvicorn[standard]>=0.27.0",
    "sqlalchemy>=2.0.25",
    "alembic>=1.13.1",
    "psycopg[binary]>=3.1.16",
    "pydantic>=2.5.3",
    "pydantic-settings>=2.1.0",
    "httpx>=0.26.0",
    "pandas>=2.1.4",
    "python-dotenv>=1.0.0",
    "click>=8.1.7",
    "rich>=13.7.0",
    "python-json-logger>=2.0.7",
    "redis>=5.0.0",
    "slowapi>=0.1.9",
    "apscheduler>=3.10.4",
    "beautifulsoup4>=4.12.0",
    "playwright>=1.40.0",
    "reportlab>=4.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.4",
    "pytest-asyncio>=0.23.3",
    "pytest-cov>=4.1.0",
    "pytest-httpx>=0.28.0",
    "pytest-benchmark>=4.0.0",
    "respx>=0.20.2",
    "ruff>=0.1.14",
    "black>=24.1.0",
    "mypy>=1.8.0",
    "ipython>=8.19.0",
]
docs = [
    "mkdocs>=1.6.0",
    "pymdown-extensions>=10.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["packages.*", "packages.core.*", "packages.tab_client.*", "packages.hrnz_scraper.*", "packages.ingest_client.*", "apps.*", "apps.backend.*"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
addopts = "-v --cov=packages --cov=apps --cov-report=term-missing --cov-report=html"
asyncio_mode = "auto"
markers = [
    "integration: Tests that require external services (PostgreSQL, etc.).",
    "slow: Tests that take a long time to run.",
    "benchmark: Performance benchmark tests.",
]

[tool.ruff]
line-length = 100
target-version = "py312"
exclude = ["tests"]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort
    "B",   # flake8-bugbear
    "C4",  # flake8-comprehensions
    "UP",  # pyupgrade
]
ignore = [
    "E501",  # line too long (handled by black)
    "B008",  # do not perform function calls in argument defaults
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]

[tool.black]
line-length = 100
target-version = ["py312"]
exclude = "/tests/"

[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true

[tool.coverage.run]
source = ["packages", "apps"]
omit = ["*/tests/*", "*/test_*.py"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "raise AssertionError",
    "raise NotImplementedError",
    "if __name__ == .__main__.:",
    "if TYPE_CHECKING:",
]
