[project]
name = "evo-blockmodels"
description = "Python SDK for using the Seequent Evo Geoscience Block Model API"
version = "0.1.1"
requires-python = ">=3.10"
license-files = ["LICENSE.md"]
dynamic = ["readme"]
authors = [
    { name = "Seequent", email = "support@seequent.com" }
]

dependencies = [
    "evo-sdk-common>=0.1.0",
    "pydantic>=2,<3",
]

[project.urls]
Source = "https://github.com/SeequentEvo/evo-python-sdk"
Tracker = "https://github.com/SeequentEvo/evo-python-sdk/issues"
Homepage = "https://www.seequent.com/"
Documentation = "https://developer.seequent.com/"

[project.optional-dependencies]
pyarrow = ["pyarrow>=19.0.0"]
aiohttp = ["evo-sdk-common[aiohttp]>=0.1.0"]
notebooks = ["evo-sdk-common[notebooks]>=0.1.0"]

[dependency-groups]
# Dev dependencies. The version is left unspecified so the latest is installed.
test = [
    "evo-blockmodels[aiohttp,pyarrow]",
    "parameterized==0.9.0",
    "pytest",
]
dev = [
    "evo-blockmodels[notebooks]",
    "bumpver",
    "coverage[toml]",
    "ruff",
    {include-group = "test"}
]
notebooks = [
    "evo-blockmodels[aiohttp,notebooks,pyarrow]",
    "jupyter",
]

[tool.ruff]
src = ["src", "tests"]
line-length = 120

[tool.ruff.lint]
extend-select = ["I", "RUF022"]

[tool.ruff.lint.isort]
known-first-party = ["evo"]

[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
include = ["/src"]

[tool.hatch.build.targets.wheel]
packages = ["src/evo"]

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# Literal TOML strings (single quotes) need no escaping of backslashes.
# Converts relative links to absolute links in PyPI
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/SeequentEvo/evo-python-sdk/tree/main/packages/$HFPR_PACKAGE_NAME/\g<2>)'
