[build-system]
requires = ["setuptools>=68", "setuptools_scm>=7"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
fallback_version = "999"

[project]
name = "cchdo.hydro"
authors = [{name = "cchdo", email = "cchdo@ucsd.edu"}]
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.10"
dynamic = ["version"]
license = {text = "BSD 3-clause"}
dependencies = [
    "cchdo.params>=2024.3",
    "xarray>=2023.9.0",
    "requests>=2.26.0",
    "numpy>=2.0.0",
    "pandas>=1.3.3",
    "appdirs",
]
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Science/Research",
    "Operating System :: OS Independent",
    "License :: OSI Approved :: BSD License",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Topic :: Scientific/Engineering",
]

[project.urls]
Homepage = "https://cchdo.ucsd.edu/"
Documentation = "https://hydro.readthedocs.io/en/latest/"
Repository = "https://github.com/cchdo/hydro.git"

[project.optional-dependencies]
netcdf = [
    "netCDF4>=1.5.7",
    "scipy",
]
selftest = [
    "cchdo.hydro[netcdf]",
    "pytest",
    "requests-mock",
]
dev = [
    "cchdo.hydro[selftest]",
    "pytest-cov",
    "pre-commit",
    "black",
    "codecov",
    "mypy",
    "ruff",
    "types-requests",
]
docs = [
    "Sphinx",
    "jupyter",
    "furo",
    "sphinx-design",
    "sphinx-autoapi",
    "nbsphinx",
]
cli = [
    "cchdo.hydro[netcdf]",
    "cchdo.auth",
    "click",
    "rich",
]
complete = [
    "cchdo.hydro[cli,docs,dev]"
]

[tool.mypy]
namespace_packages = true
explicit_package_bases = true

[[tool.mypy.overrides]]
module = [
    "appdirs.*",
    "pandas",
    "scipy.*",
    "netCDF4.*",
    "cftime.*",
    "cchdo.auth.*",
]
ignore_missing_imports = true

[tool.ruff]
target-version = "py310"
extend-exclude = ["*.ipynb"]

[tool.ruff.lint]
# E402: module level import not at top of file
# E501: line too long - let black worry about that
# E731: do not assign a lambda expression, use a def
ignore = [
    "E402",
    "E501",
    "E731",
]
select = [
    # Pyflakes
    "F",
    # Pycodestyle
    "E",
    "W",
    # isort
    "I",
    # Pyupgrade
    "UP",
    # Tidy imports
    "TID",
]

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