[project]
    authors         = [{ name = "Lucas Parzianello", email = "lucaspar@users.noreply.github.com" }]
    description     = "Just a demo of the uv package manager for Python."
    license         = { file = "LICENSE" }
    name            = "uv-demo"
    readme          = "README.md"
    requires-python = ">=3.11"
    version         = "0.2.5"

    # https://pypi.org/classifiers/
    classifiers = [
        "Development Status :: 1 - Planning",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: Unix",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Programming Language :: Python :: 3.13",
        "Programming Language :: Python :: Implementation :: CPython",
        "Topic :: Terminals",
        "Typing :: Typed",
    ]

    # https://packaging.python.org/en/latest/specifications/dependency-specifiers/
    dependencies = ["loguru>=0.7.2"]

    [project.scripts]
        uv-demo     = "uv_demo:say_hello"
        uv-demo-bye = "uv_demo:say_goodbye"

    [project.urls]
        Issues     = "https://github.com/lucaspar/uv-demo/issues"
        Releases   = "https://github.com/lucaspar/uv-demo/releases"
        Repository = "https://github.com/lucaspar/uv-demo"

    [project.optional-dependencies]
        tox-uv = ["tox>=4.23.2"]

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

[tool.coverage.html]
    directory = "tests/htmlcov"

[tool.coverage.report]
    # https://coverage.readthedocs.io/en/latest/source.html

    # https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
    exclude_also = [
        # 1. Exclude an except clause of a specific form:
        "except ValueError:\\n\\s*assume\\(False\\)",
        # 2. Comments to turn coverage on and off:
        "no cover: start(?s:.)*?no cover: stop",
        # 3. A pragma comment that excludes an entire file:
        "\\A(?s:.*# pragma: exclude file.*)\\Z",
        # common exclusions
        "def __repr__",
        "if self.debug:",
        "if settings.DEBUG",
        "raise AssertionError",
        "raise NotImplementedError",
        "if 0:",
        "if __name__ == .__main__.:",
        "if TYPE_CHECKING:",
        "class .*\\bProtocol\\):",
        "@(abc\\.)?abstractmethod",
    ]

[tool.coverage.run]
    omit = ["tests/*", "**/main.py", "**/__init__.py"]

[tool.deptry]
    # https://deptry.readthedocs.io/en/latest/
    # extend_exclude = ["docs", "tests"]
    [tool.deptry.per_rule_ignores]
        DEP002 = [
            "tox", # used from makefile and gh actions
        ]
        DEP003 = [
            "uv_demo", # ignore the package itself
        ]

    [tool.hatch.build.targets.sdist]
        # https://hatch.pypa.io/latest/config/build/
        exclude = [".github", "*.env*", "*secret*", "config/"]

[tool.pytest]

    [tool.pytest.ini_options]
        # pytest
        #   https://docs.pytest.org/en/stable/reference/reference.html#confval-addopts
        # pytest-cov
        #   https://pytest-cov.readthedocs.io/en/latest/config.html
        # more verbose:
        # addopts = "--maxfail=2 --new-first -rf --strict-markers --cov=src --cov-report=html --show-capture=stdout -o log_cli=true --showlocals --tb=long --capture=no"
        # less verbose:
        addopts              = "--maxfail=2 --new-first -rf --strict-markers --cov=src --cov-report=html --show-capture=stdout -o log_cli=true --tb=short"
        console_output_style = "progress"
        log_auto_indent      = true
        log_cli              = true
        log_cli_level        = "WARN"
        log_date_format      = "%Y-%m-%d %H:%M:%S"
        minversion           = "8.0"
        testpaths            = ["tests"]
        verbosity_test_cases = 2

[tool.uv]
    dev-dependencies = [
        "deptry>=0.20.0",
        "mypy>=1.13.0",
        "pdoc>=15.0.0",
        "pre-commit>=4.0.1",
        "pytest-cov>=5.0.0",
        "pytest>=8.3.3",
        "rich>=13.9.3",
        "ruff>=0.6.9",
        "tox>=4.23.2",
    ]
