[build-system]
requires = ["setuptools>=64.0.0", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "Paidiverpy"
description = "A library to preprocess image data."
requires-python = ">=3.10"
keywords = ["data", "paidiver", "noc"]
authors = [
  {name = "Tobias Ferreira", email = "tobias.ferreira@noc.ac.uk"},
  {name = "Mojtaba Masoudi", email = "mojtaba.masoudi@noc.ac.uk"},
  {name = "Van Loïc Audenhaege", email = "loic.audenhaege@noc.ac.uk"},
  {name = "Erik Orenstein", email = "erik.orenstein@noc.ac.uk"},
  {name = "Colin Sauze", email = "colin.sauze@noc.ac.uk"},
  {name = "Jennifer Durden", email = "jennifer.durden@noc.ac.uk"}
]
maintainers = [{name = "Tobias Ferreira", email = "tobias.ferreira@noc.ac.uk"}]
classifiers = [
  "Programming Language :: Python :: 3",
  "Intended Audience :: Science/Research"
]

dependencies = [
  "pandas>=2.2.2",
  "pillow>=10.4.0",
  "scikit-image>=0.24.0",
  "scipy>=1.14",
  "tqdm>=4.66.4",
  "PyYAML>=6.0",
  "openpyxl>=3.1",
  "shapely==2.0.7",
  "geopy>=2.4.1",
  "geopandas>=1.0.1",
  "dask-image==2024.5.3",
  "dask>=2024.10.0",
  "distributed>=2024.10.0",
  "jsonschema>=4.23.0",
  "matplotlib>=3.5.0",
  "ipython>=8.26.0",
  "dask-jobqueue>=0.9.0",
  "python-dotenv>=1.0.1",
  "boto3>=1.35.92",
  "botocore>=1.35.92",
  "opencv-python>=4.11",
  "rawpy>=0.24.0",
  "pydantic>=2.9.2",
  "requests>=2.25.1",
  "xarray>=2024.12.0",
  ]
license = {file = "LICENSE"}
version = "0.2.0"
readme = {file = "README.rst", content-type = "text/x-rst"}

[project.optional-dependencies]
dev = [
    "build",  # build is not only used in publishing (below), but also in the template's test suite
    "bump-my-version",
    "coverage [toml]",
    "pytest",
    "pytest-cov",
    "ruff==0.9.5",
    # "pyright",
    "sphinx",
    "sphinx_rtd_theme",
    "sphinx-autoapi",
    "myst_parser",
    "plotly",  # for benchmark plotting
]
docs = [
    "sphinx",
    "sphinx_rtd_theme",
    "sphinx__theme",
    "sphinx-autoapi",
    "sphinx-copybutton",
    "sphinx-book-theme",
    "myst_parser",
    "nbsphinx",
    "numpydoc",
    "sphinx-last-updated-by-git",
    "sphinx-codeautolink",
    "sphinx_design",
    "pickleshare"
]
publishing = [
    "build",
    "twine",
    "wheel",
]
test = ["pytest >= 7.2.0", "pytest-cov"]

[project.urls]
Repository = "https://github.com/paidiver/paidiverpy"
Issues = "https://github.com/paidiver/paidiverpy/issues"
Changelog = "https://github.com/paidiver/paidiverpy/CHANGELOG.md"
ReadTheDocs = "https://paidiverpy.readthedocs.io"

[project.scripts]
paidiverpy = "cli.main:main"

[tool.setuptools.dynamic]
version = {attr = "paidiverpy.__init__.__version__"}

[tool.setuptools.packages.find]
where = ["src"]
include = ["*"]
exclude = ["*__pycache__*"]
namespaces = true

[tool.setuptools.package-data]
paidiverpy = ["*"]

[tool.pytest.ini_options]
testpaths = ["tests"]

addopts = """
--cov=src/paidiverpy
--cov-report=xml:cov.xml
--cov-report=html:coverage_html
--cov-report=term-missing
--cov-config=.coveragerc
-v
-ra
-s
"""

[tool.coverage.run]
branch = true
source = ["src/paidiverpy"]
command_line = "-m pytest"
parallel = true
concurrency = ["thread", "multiprocessing"]
relative_files = true

# [tool.pyright]
# include = ["src", "tests"]
# exclude = ["build", "dist", "**/__pycache__"]
# typeCheckingMode = "strict"
# reportMissingImports = true
# reportUnusedImport = true
# pythonVersion = "3.11"

[tool.ruff]
line-length = 150
output-format = "concise"
extend-exclude = ["docs"]

[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Enable Pyflakes `E` and `F` codes by default.
select = ["ALL"]
ignore = [
    "ANN204", # Missing return type annotation for special (dunder) method
    "FBT",    # Using boolean function arguments
    "TD",     # TODOs
    "FIX001", # Resolve FIXMEs
    "FIX002", # Resolve TODOs
    "B028",   # No explicit `stacklevel` keyword argument found in warning
    # No docstrings required in the following cases
    "D105", # Missing docstring in magic method
    "D107", # Missing docstring in `__init__`
    "S324", # Probable use of insecure hash functions in `hashlib`
    "TRY400",
    "COM812",
    "ISC001",
    "PLR0913",
    "ERA001",  # Commented code
    "PD011",

]
pydocstyle.convention = "google"

[tool.ruff.lint.per-file-ignores]
# Tests can ignore a few extra rules
"tests/**.py" = [
    "ANN201", # Missing return type annotation for public function
    "PT011",  # Missing `match` parameter in `pytest.raises()`
    "S101",   # Use of assert is detected
]

[tool.ruff.lint.isort]
known-first-party = ["paidiverpy"]
force-single-line = true
no-lines-before = ["future","standard-library","third-party","first-party","local-folder"]


[tool.bumpversion]
current_version = "0.2.0"  # Current version
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true  # Automatically tag the commit with the new version
sign_tags = false
tag_name = "v{new_version}"  # Tag format (e.g., v0.1.2)
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true  # Automatically commit the changes
message = "Bump version: {current_version} → {new_version}"
commit_args = "--no-verify"  # Optional: prevent pre-commit hooks from running during version bump
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []

[[tool.bumpversion.files]]
filename = "src/paidiverpy/__init__.py"  # File to update the version
[[tool.bumpversion.files]]
filename = "pyproject.toml"  # File to update the version in the [project] section
[[tool.bumpversion.files]]
filename = "CITATION.cff"  # Optional, if you want to include this
[[tool.bumpversion.files]]
filename = "docs/conf.py"  # Optional, if you want to include this
