[project]
name = "brahe"
dynamic = ["version"]
description = "Brahe is a modern satellite dynamics library for research and engineering applications designed to be easy-to-learn, high-performance, and quick-to-deploy. The north-star of the development is enabling users to solve meaningful problems and answer questions quickly, easily, and correctly."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
license = { file = "LICENSE.md" }
keywords = ["space", "astrodynamics", "satellite", "research"]
authors = [
    { name = "Duncan Eddy", email = "duncan.eddy@gmail.com" }
]
maintainers = [
    { name = "Duncan Eddy", email = "duncan.eddy@gmail.com" }
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: MIT License",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: MacOS :: MacOS X",
    "Operating System :: POSIX :: Linux",
    # Specify the Python versions you support here.
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
]
dependencies = [
    "numpy>=1.0.0",
    "rich>=14.0.0",
    "typer>=0.16.0",
    "matplotlib>=3.9.4",
    "plotly>=6.0.0",
    "cartopy>=0.23.0",
    "shapely>=2.0.0",
    "pillow>=10.0.0",
    "httpx>=0.27.0",
    "polars>=1.0.0",
    "kaleido>=0.2.0",
    "loguru>=0.7.0",
]

[project.urls]
Documentation = "https://duncaneddy.github.io/brahe/"
Repository = "https://github.com/duncaneddy/brahe"
Issues = "https://github.com/duncaneddy/brahe/pulls"

[project.optional-dependencies]
plots = ["scienceplots>=2.0.0"]
all = [
      "brahe[plots]",
]

[project.scripts]
brahe = "brahe.cli.__main__:main"

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[dependency-groups]
test = [
    "pytest>=7.4.4",
    "pytest-cov>=3.0.0",
    "pytest-order>=1.3.0",
    "coverage>=7.0.0",
]
docs = [
    "mkdocs<2.0.0",
    "properdocs",
    "mike>=2.0.0",
    "mkdocs-awesome-nav>=3.2.0",
    "mkdocs-git-revision-date-localized-plugin>=1.4.7",
    "mkdocs-material>=9.6.20",
    "mkdocs-minify-plugin>=0.8.0",
    "mkdocs-section-index>=0.3.10",
    "mkdocs-table-reader-plugin>=3.1.0",
    "mkdocstrings>=0.30.0",
    "mkdocstrings-python>=1.18.2",
    "neoteroi-mkdocs>=1.1.3",
    "pyo3-stubgen>=0.3.0",
]
dev = [
    "pre-commit>=4.3.0",
    "towncrier>=25.8.0",
    "maturin>=1.0,<2.0",
    "twine>=5.0.0",
    "pytest-order>=1.3.0",
    "skyfield>=1.53",
    { include-group = "test" },
    { include-group = "docs" },
]

[tool.maturin]
# The cdylib that backs `brahe._brahe` lives in the `brahe-py` workspace crate.
# The pure-Rust `brahe` crate at the repo root is published to crates.io and
# builds only an rlib, avoiding an unnecessary cdylib artifact for Rust consumers.
manifest-path = "crates/brahe-py/Cargo.toml"
# We name the rust module with a leading underscore to avoid a name conflict with the python module
# This is a workaround for IDEs to avoid confusion in function naming.
#
# See: https://www.maturin.rs/project_layout#import-rust-as-a-submodule-of-your-project
module-name = "brahe._brahe"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
features = ["pyo3/extension-module"]
# Include type stub file in distribution
include = [
    "brahe/_brahe.pyi",
    "brahe/py.typed",
    "brahe/plots/data/__init__.py",
    "brahe/plots/data/world.topo.200410.3x5400x2700.png",
]

[tool.pytest.ini_options]
markers = [
    "ci: marks tests that require network access or are only run in CI environments",
]
# By default, exclude CI tests unless explicitly requested with -m ci
addopts = "-m 'not ci'"
testpaths = [
    "tests",
]

[tool.coverage.run]
source = ["brahe"]
omit = [
    "brahe/_brahe.pyi",
    "brahe/plots/*",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
    "if __name__ == .__main__.",
    "if TYPE_CHECKING:",
]
show_missing = true

[tool.ruff.lint]
# Ignore F403 (import * used) in __init__.py for backward compatibility pattern
extend-ignore = ["F403"]

[tool.towncrier]
# Changelog configuration using Keep a Changelog format
package = "brahe"
filename = "CHANGELOG.md"
directory = "news"
template = "news/.template.md"
title_format = "## [{version}] - {project_date}"
issue_format = "[#{issue}](https://github.com/duncaneddy/brahe/pull/{issue})"
underlines = ["", "", ""]
start_string = "<!-- towncrier release notes start -->\n"

[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true

[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true

[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true

[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true
