[build-system]
requires = ["setuptools>=64.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "geepers"
authors = [
  { name = "Scott Staniewicz", email = "scott.j.staniewicz@jpl.nasa.gov" },
]
description = "Download GPS data and compare to InSAR"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"

classifiers = [
  "Intended Audience :: Developers",
  "Intended Audience :: Science/Research",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Programming Language :: Python",
  "Topic :: Scientific/Engineering",
  "Typing :: Typed",
]
license = { file = "LICENSE.txt" }

dependencies = [
  "pandas",
  "lxml",
  "geopandas",
  "pyogrio",
  "xarray",
  "dask>=2025",
  "pyproj",
  "rasterio",
  "rioxarray",
  "shapely>=2",
  "requests",
  "tqdm",
  "zarr",
  "tyro>=0.9.24",
  "pandera",
]


# The version will be written into a version.py upon install, auto-generated
# see section: setuptools_scm
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
# dependencies will be read from text files
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/isce-framework/geepers"
"Bug Tracker" = "https://github.com/isce-framework/geepers/issues"
Discussions = "https://github.com/isce-framework/geepers/discussions"
Changelog = "https://github.com/isce-framework/geepers/releases"

# Entry points for the command line interface
[project.scripts]
geepers = "geepers.cli:cli"


[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]

[tool.pixi.pypi-dependencies]
geepers = { path = ".", editable = true }

[tool.pixi.dependencies]
python = ">=3.11"
pip = ">=21.3"
git = "*"
pandas = "*"
geopandas-base = "*"
pyogrio = "*"
xarray = "*"
dask = ">=2025.5.1"
pyproj = "*"
rasterio = "*"
rioxarray = ">=0.19.0"
shapely = "*"
requests = ">=2.32.4"
tqdm = ">=4.67.1"
zarr = "*"
tyro = ">=0.9.24,<0.10"
pandera = "*"

[tool.pixi.tasks]
check = "pre-commit run -a"
test = "pytest"
docs = "mkdocs serve"


# pixi install -e test
[tool.pixi.feature.test.dependencies]
pre-commit = "*"
pytest = "*"
pytest-cov = "*"
pytest-randomly = "*"
pytest-recording = ">=0.13.2"
pytest-xdist = "*"
ruff = "*"
matplotlib = ">=3.10.3"
ipython = ">=9.3.0"
lxml = "*"
ipdb = "*"
contextily = "*"

[tool.pixi.feature.docs.dependencies]
mkdocs = "*"
mkdocs-gen-files = "*"
mkdocs-jupyter = "*"
mkdocs-literate-nav = "*"
mkdocs-material = "*"
pymdown-extensions = "*"
matplotlib = ">=3.10.3"
ipython = ">=9.3.0"
lxml = "*"
contextily = ">=1.6.2,<2"

# pixi install -e docs
[tool.pixi.feature.docs.pypi-dependencies]
mkdocstrings = { extras = ["python"] }
mkdocs-section-index = "*"


[tool.pixi.environments]
test = ["test"]
docs = ["docs"]


[tool.setuptools_scm]
# https://github.com/pypa/setuptools_scm#configuration-parameters
write_to = "src/geepers/_version.py"
# https://github.com/pypa/setuptools_scm#version-number-construction
version_scheme = "no-guess-dev" # Will not guess the next version

[tool.ruff]
src = ["src"]
unsafe-fixes = true

[tool.ruff.lint]
select = [
  "A",      # flake8-builtins
  "ARG",    # flake8-unused-arguments
  "B",      # flake8-bugbear
  "C4",     # flake8-comprehensions
  "D",      # pydocstyle
  "E",      # pycodestyle (errors)
  "W",      # pycodestyle (warnings)
  "EM",     # flake8-errmsg
  "EXE",    # flake8-executable
  "F",      # Pyflakes
  "I",      # isort
  "ISC",    # flake8-implicit-str-concat
  "N",      # pep8-naming
  "NPY201", # numpy 2.0 depgrcations
  "PGH",    # pygrep-hooks
  "PIE",    # flake8-pie
  "PL",     # Pylint
  "PT",     # flake8-pytest-style
  "PTH",    # flake8-use-pathlib
  "PYI",    # flake8-pyi
  "RUF",    # Ruff-specific rules
  "SIM",    # flake8-simplify
  "TRY",    # tryceratops
  "UP",     # pyupgrade  <- not working with Pydantic lower python versions
  "YTT",    # flake8-2020
]

ignore = [
  "PTH123", # `open()` should be replaced by `Path.open()`
  "PLR",    # Pylint Refactor
  "D100",   # Missing docstring in public module
  "D104",   # Missing docstring in public package
  "D105",   # Missing docstring in magic method
  "D102",   # D102: Missing docstring in public method (TODO: remove this ignore)
  "D213",   # D213: Multi-line docstring summary should start at the second line
  "D203",   # 1 blank line required before class docstring
  "N806",   # Variable _ in function should be lowercase
  "SIM108", # Use ternary operator
]

[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["F401", "F403"]
"tests/**" = ["D", "N", "PTH", "ARG001", "PLR2004", "E501"]
"scripts/*" = ["F401"]
"src/geepers/uncertainty.py" = ["RUF002"]                   # let us use sigma here
"src/geepers/schemas.py" = ["D106"]

[tool.black]
target-version = ["py311", "py312", "py313"]
preview = true

[tool.mypy]
python_version = "3.11"
ignore_missing_imports = true
plugins = ["pandera.mypy"]


[tool.pytest.ini_options]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER"
addopts = "  --cov=geepers  --doctest-modules --randomly-seed=1234 --ignore=scripts --ignore=docs --ignore=data"
filterwarnings = [
  "error",
  # https://github.com/dateutil/dateutil/pull/1285 will be released, but not yet
  "ignore:datetime.datetime.utcfromtimestamp.*:DeprecationWarning",
  "ignore:.*shapely.geos.*:DeprecationWarning",
  # Ignore deprecation warnings from gps module during testing of deprecated functionality
  "ignore:The 'geepers.gps' module is deprecated.*:DeprecationWarning",
]
