[project]
name = "py-invoices"
version = "1.0.2"
description = "Framework-agnostic invoice management with pluggable storage backends"
authors = [{name = "Roman Medvedev", email = "pypi@romavm.dev"}]
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
dependencies = [
    "pydantic-invoices>=1.1.0",
    "pydantic>=2.0.0",
    "pydantic-settings>=2.0.0",
]

[project.optional-dependencies]
# Storage backends
sqlite = [
    "sqlmodel>=0.0.22",
]
postgres = ["sqlmodel>=0.0.22", "psycopg2-binary>=2.9.0"]
mysql = ["sqlmodel>=0.0.22", "pymysql>=1.1.0"]
memory = []  # No extra dependencies

# HTML generation
html = [
    "jinja2>=3.1.5",
]

# PDF generation
pdf = [
    "weasyprint>=63.1",
    "jinja2>=3.1.5",
    "pyyaml>=6.0",
]

# All features
all = ["py-invoices[sqlite,postgres,mysql,pdf]"]

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

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

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--strict-markers",
    "--strict-config",
    "-ra",
]

[tool.coverage.run]
source = ["py_invoices"]
branch = true

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false

[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true

[tool.ruff]
line-length = 100
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
ignore = []

[tool.uv.sources]
pydantic-invoices = { path = "../pydantic-invoices", editable = true }

[dependency-groups]
# Development dependencies
dev = [
    "pytest>=8.0.0",
    "pytest-cov>=4.1.0",
    "mypy>=1.8.0",
    "ruff>=0.2.0",
]
