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

[project]
name = "attipy"
authors = [
  { name="Vegard R. Solum", email="vegard.rorvik.solum@gmail.com" },
]
description = "A Python library for attitude estimation using inertial measurement units (IMUs)"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]
dependencies = [
  "numba",
  "numpy",
  "scipy",  # required by numba
]

[project.urls]
Homepage = "https://github.com/vegardrsolum/attipy"
Issues = "https://github.com/vegardrsolum/attipy/issues"

[tool.hatch.version]
path = "src/attipy/__about__.py"

[tool.hatch.envs.test]
dependencies = [
  "black",
  "coverage[toml]",
  "isort",
  "mypy",
  "pytest",
  "pytest-cov",
  "scipy"  # used as reference implementation for rotations
]

[tool.hatch.envs.test.scripts]
style = [
  "black --check .",
  "isort --check . --profile black"
]
unit = "pytest --cov-config=pyproject.toml --cov --cov-report html"
type = "mypy"
complete = [
  "style",
  "type",
  "unit",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

[tool.coverage.run]
branch = true
source = ["src/attipy"]

[tool.coverage.report]
ignore_errors = false
show_missing = true
omit = ["src/attipy/__about__.py"]
exclude_lines = [
  # Have to re-enable the standard pragma
  "pragma: no cover",
  # Don't complain if tests don't hit defensive assertion code:
  "raise AssertionError",
  "raise NotImplementedError",
  "AbstractMethodError",
  # Don't complain if non-runnable code isn't run:
  "if 0:",
  "if __name__ == .__main__.:",
  "if TYPE_CHECKING:",
]

[tool.coverage.html]
directory = "coverage_html_report"

[tool.mypy]
files = ["src/attipy"]
strict = true
ignore_missing_imports = true
