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

[project]
name = "crump"
version = "0.5.3"
description = "Csv/cdf Read and dUMP - Sync CSV, Parquet, and CDF science files into PostgreSQL database"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [
    { name = "Alastair Crabtree", email = "a.crabtree@imperial.ac.uk" },
]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "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",
]
dependencies = [
    "click>=8.1.7",
    "rich>=13.7.0",
    "pyyaml>=6.0.1",
    "psycopg[binary]>=3.1.0",
    "cdflib>=1.3.6",
    "pyarrow>=18.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.0.0",
    "pytest-cov>=4.1.0",
    "pytest-mock>=3.12.0",
    "ruff>=0.1.0",
    "mypy>=1.8.0",
    "testcontainers[postgresql]>=4.0.0",
    "mkdocs>=1.5.0",
    "mkdocs-material>=9.5.0",
    "mkdocs-autorefs>=0.5.0",
]

[project.scripts]
crump = "crump.cli:main"

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

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--verbose",
    # "--cov=crump",
    # "--cov-report=term-missing",
    # "--cov-report=html",
    # "--cov-report=xml",
]
markers = [
    "integration: marks tests as integration tests (require Docker)",
]
filterwarnings = [
    "ignore::DeprecationWarning:testcontainers",
]

[tool.coverage.run]
source = ["src/crump"]
omit = ["*/tests/*", "*/__pycache__/*"]
relative_files = true

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

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

[tool.ruff.lint]
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort
    "B",   # flake8-bugbear
    "C4",  # flake8-comprehensions
    "UP",  # pyupgrade
    "ARG", # flake8-unused-arguments
    "SIM", # flake8-simplify
]
ignore = [
    "E501",  # line too long (handled by formatter)
]

[tool.ruff.lint.per-file-ignores]
"tests/**/*" = ["ARG", "S101"]

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
