[project]
name = "cartes"
version = "0.8.2"
description = "A generic toolbox for building maps in Python"
authors = [{ name = "Xavier Olive", email = "git@xoolive.org" }]
license = "MIT"
readme = "readme.md"
requires-python = ">=3.9"
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Information Technology",
  "Intended Audience :: Science/Research",
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
  "Topic :: Scientific/Engineering :: GIS",
  "Topic :: Scientific/Engineering :: Information Analysis",
  "Topic :: Scientific/Engineering :: Visualization",
  "Topic :: Software Development :: Libraries",
  "License :: OSI Approved :: MIT License",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Typing :: Typed",
]
dependencies = [
  "altair>=5.4.1",
  "appdirs>=1.4.4",
  "beautifulsoup4>=4.12.3",
  "cartopy>=0.23.0; python_version<'3.10'",
  "cartopy>=0.24.1; python_version>='3.10'",
  "fastapi>=0.115.0",
  "geopandas>=1.0.1",
  "httpx[http2]>=0.27.2",
  "jsonschema>=4.23.0",
  "lxml>=5.3.0",
  "matplotlib>=3.9.2",
  "nest-asyncio>=1.6.0",
  "numpy>=2.0.2; python_version<'3.10'",
  "numpy>=2.1.2; python_version>='3.10'",
  "pandas>=2.2.3",
  "pyproj<3.7.1; python_version<'3.10'",
  "pyproj>=3.7.0; python_version>='3.10'",
  "scipy>=1.13.1; python_version<'3.10'",
  "scipy>=1.14.1; python_version>='3.10'",
  "shapely>=2.0.6",
  "tqdm>=4.66.5",
  "uvicorn>=0.31.0",
]

[project.scripts]
cartes = 'cartes.tiles.fastapi:main'

[project.urls]
Documentation = "https://cartes-viz.github.io/"
Code = "https://github.com/xoolive/cartes/"
Issues = "https://github.com/xoolive/cartes/issues/"
Releases = "https://github.com/xoolive/cartes/releases/"

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

[tool.uv]
dev-dependencies = [
  "jupyter-sphinx>=0.5.3",
  "mypy>=1.11.2",
  "pre-commit>=3.8.0",
  "pytest>=8.3.3",
  "pytest-cov>=5.0.0",
  "ruff>=0.6.8",
  "sphinx>=7.4.7; python_version>'3.11'",
  "sphinx-rtd-theme>=2.0.0; python_version>'3.11'",
  "vega-datasets>=0.9.0",
  "exceptiongroup>=1.2.2;python_version<'3.11'",
]

[tool.ruff]
lint.select = [
  "E",
  "W",   # pycodestyle
  "F",   # pyflakes
  "I",   # isort
  "NPY", # numpy
  # "PD",  # pandas
  "DTZ", # flake8-datetimez
  "RUF",
]
line-length = 80
target-version = "py39"

[tool.ruff.lint.isort]
known-first-party = ["numpy", "pandas", "pyproj", "shapely"]

[tool.mypy]
# Specify the target platform details in config, so your developers are
# free to run mypy on Windows, Linux, or macOS and get consistent
# results.
python_version = 3.9

exclude = ["_ignore"]

check_untyped_defs = true
follow_imports = "normal"
ignore_missing_imports = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unused_ignores = true

[tool.pytest.ini_options]
addopts = "--log-level=INFO --color=yes --doctest-modules --doctest-report ndiff"
testpaths = ["src", "tests"]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "ELLIPSIS"]
