[project]
name = "arbor"
dynamic = ["version"]
readme = {file = "README.md", content-type = "text/markdown"}
license = "BSD-3-Clause"
license-files = ["LICENSE"]
description = "High performance simulation of networks of multicompartment neurons."
requires-python = ">=3.10"
keywords = ["simulator", "neuroscience", "morphological detail", "HPC", "GPU", "C++"]
authors = [
    {name = "Arbor Dev Team", email = "contact@arbor-sim.org"}
]
maintainers = [
    {name = "Arbor Dev Team", email = "contact@arbor-sim.org"}
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Science/Research",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: C++"
]
dependencies = [
    "numpy"
]


[project.entry-points."cmake.root"]
arbor = "arbor"

[project.scripts]
modcc = "arbor:modcc"
arbor-build-catalogue = "arbor:build_catalogue"

[tool.scikit-build]
cmake.args = [
        "-DARB_WITH_PYTHON=ON",
]
sdist.include = ["ext/*/.git"]
wheel.install-dir = "arbor"
wheel.packages = []

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "VERSION"
regex = "(?P<value>\\d+\\.\\d+\\.\\d+(-.+)?)"

[tool.ruff]
exclude = [
    ".direnv",
    ".eggs",
    ".git",
    ".ipynb_checkpoints",
    "_deps",
    ".ruff_cache",
    ".venv",
    ".vscode",
    "build",
    "dist",
    "ext",
    "install-*",
    "doc/scripts/inputs.py",
    "doc/scripts/make_images.py",
    ".*",
    "spack/package.py"]

line-length = 88
indent-width = 4
target-version = "py312"

[tool.ruff.lint]
ignore = [ # for black
           "E203", "E231",
           # zealous line lengths
           "E501",
           # ambiguous varnames I ./. l etc
           "E741",
           # Ruff doesn't like this rule
           "ISC001",
           # old school zip
           "B905"]
select = ["C", "E", "F", "W", "B"]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
mccabe.max-complexity = 15
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.per-file-ignores]
"python/example/brunel/analysis.py" = ["F405", "F403"]
"python/example/brunel/arbor_brunel.py" = ["F405", "F403"]
"python/example/brunel/nest_brunel.py" = ["F405", "F403"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# Disable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
docstring-code-format = false
docstring-code-line-length = "dynamic"

[project.urls]
homepage = "https://arbor-sim.org"
documentation = "https://docs.arbor-sim.org"
repository = "https://github.com/arbor-sim/arbor"
changelog = "https://github.com/arbor-sim/arbor/releases"

[build-system]
requires = [
    "scikit-build-core",
    "numpy",
    "pybind11-stubgen",
]
build-backend = "scikit_build_core.build"

[tool.cibuildwheel]
build-frontend = "build"
build = ["*linux*","*macosx*"]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
skip = ["cp36*", "cp37*", "cp38*", "cp39*", "*musllinux*", "pp*"]
test-command = "python -m unittest discover -v -s {project}/python"
dependency-versions = "latest"

[tool.cibuildwheel.macos]
archs = ["arm64"]
environment = { MACOSX_DEPLOYMENT_TARGET = "14.0" }

[tool.cibuildwheel.linux]
archs = ["x86_64"]

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
