[build]
ignore-vcs = true
artifacts = [
    "*.so",
    "*.dll",
]

[build.targets.wheel]
packages = ["src/fastomit"]

[build.targets.wheel.hooks.cython]
dependencies = [
  "hatch-cython>=0.2.2"
]

[build.targets.wheel.hooks.cython.options]
directives = { language_level = 3, boundscheck = false }

env = [
  { env = "CC", arg = "c++", platforms = ["darwin", "linux"] },
  { env = "CPP", arg = "c++", platforms = ["darwin", "linux"] },
  { env = "CXX", arg = "c++", platforms = ["darwin", "linux"] },
]
cythonize_kwargs = { annotate = true, nthreads = 4 }

[[envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]

[envs.lint]
detached = true
dependencies = [
  "black>=23.1.0",
  "mypy>=1.0.0",
  "ruff>=0.0.243",
]


[envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/funcclasses tests}"
style = [
  "ruff {args:.}",
  "black --check --diff {args:.}",
]
fmt = [
  "black {args:.}",
  "ruff --fix {args:.}",
  "style",
]
all = [
  "style",
  "typing",
]

[envs.default]
dependencies = [
  "hatch",
  "Cython",
  "coverage",
  "pytest",
  "pytest-benchmark",
  "beartype",
]

[envs.default.scripts]
install = "python bootstrap.py"
test = "pytest {args:tests}"
bench = "EXHAUSTIVE=1 pytest -vv --benchmark-json output.json {args:tests}"
test-cov = "coverage run -m pytest -vv {args:tests}"
cov-report = [
  "- coverage combine",
  "coverage report",
]
cov = [
  "install",
  "test-cov",
  "cov-report",
]
