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

[project]
name = "dbslice"
version = "0.5.0"
description = "Extract minimal, referentially-intact database subsets for local development"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
    { name = "nabroleonx" }
]
keywords = ["database", "subset", "extraction", "postgresql", "mysql", "sqlite", "cli"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Topic :: Database",
    "Topic :: Software Development :: Testing",
    "Topic :: Utilities",
]
dependencies = [
    "typer>=0.9.0",
    "psycopg2-binary>=2.9.9",
    "rich>=13.0.0",
    "faker>=20.0.0",
    "pyyaml>=6.0.0",
]

[project.optional-dependencies]
mysql = ["mysql-connector-python>=8.0.0"]

[dependency-groups]
dev = [
    "pytest>=7.0.0",
    "pytest-cov>=4.0.0",
    "mypy>=1.0.0",
    "ruff>=0.1.0",
    "types-pyyaml>=6.0.0",
    "mkdocs>=1.5.0",
    "mkdocs-material>=9.5.0",
    "pre-commit>=3.0.0",
]

[project.scripts]
dbslice = "dbslice.cli:app"

[project.urls]
Homepage = "https://github.com/nabroleonx/dbslice"
Documentation = "https://nabroleonx.github.io/dbslice/"
Repository = "https://github.com/nabroleonx/dbslice"
Issues = "https://github.com/nabroleonx/dbslice/issues"

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

[tool.hatch.build.targets.sdist]
include = [
    "/src",
    "/tests",
    "/README.md",
    "/LICENSE",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
addopts = "-v --tb=short"
markers = [
    "integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
    "performance: marks tests as performance benchmarks",
]

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

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

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

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
branch = "master"
commit_message = "release: v{version}"
tag_format = "v{version}"

[tool.semantic_release.commit_parser_options]
allowed_tags = ["feat", "fix", "perf", "refactor", "build"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "refactor", "build"]
