[project]
name = "chemformula"
version = "1.5.0"
description = "ChemFormula is a Python class for working with chemical formulas. It allows parsing chemical formulas, generating formatted output strings and calculating formula weights."
readme = "README.md"
authors = [
    {name = "Axel Müller", email = "molshape@gmx.net"},
]
maintainers = [
    {name = "Axel Müller", email = "molshape@gmx.net"},
]
requires-python = ">=3.10"
dependencies = [
    "casregnum>=1.1.2",
]
classifiers = [
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Operating System :: OS Independent",
    "License :: OSI Approved :: MIT License",
    "Topic :: Scientific/Engineering :: Chemistry",
]

license = "MIT"
license-files = ["LICENSE"]

[project.urls]
Homepage = "https://github.com/molshape/ChemFormula"
Issues = "https://github.com/molshape/ChemFormula/issues"
Repository = "https://github.com/molshape/ChemFormula.git"

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

[tool.uv]
dev-dependencies = [
    "mypy>=1.18.1",
    "pytest>=8.4.1",
    "pytest-cov>=7.0.0",
    "pytest-sugar>=1.1.1",
    "ruff>=0.13.0",
    "twine>=6.2.0",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--strict-markers",
    "--strict-config",
    "--verbose",
    "--cov=src",
    "--cov-branch",
    "--cov-report=term",
    "--cov-report=xml",
]

[tool.ruff]
line-length = 88
target-version = "py39"

[tool.ruff.lint]
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 formatter
]

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

[tool.coverage.run]
source = ["src"]
omit = ["tests/*"]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "def __repr__",
    "if self.debug:",
    "if settings.DEBUG",
    "raise AssertionError",
    "raise NotImplementedError",
    "if 0:",
    "if __name__ == .__main__.:",
]
