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


[project]
name = "ngff-zarr"
description = 'A lean and kind Open Microscopy Environment (OME) Next Generation File Format (NGFF) Zarr implementation.'
readme = "README.md"
requires-python = ">=3.8"
license = "MIT"
keywords = []
authors = [{ name = "Matt McCormick", email = "matt.mccormick@kitware.com" }]
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Science/Research",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: MIT License",
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: Implementation :: CPython",
  "Topic :: Scientific/Engineering",
]
dependencies = [
  "dask[array]",
  "itkwasm >= 1.0b171",
  "itkwasm-downsample >= 1.2.0",
  "numpy",
  "platformdirs",
  "psutil; sys_platform != \"emscripten\"",
  "rich",
  "rich-argparse",
  "typing_extensions",
  "zarr",
]
dynamic = ["version"]

[project.urls]
Documentation = "https://github.com/thewtex/ngff-zarr#readme"
Issues = "https://github.com/thewtex/ngff-zarr/issues"
Source = "https://github.com/thewtex/ngff-zarr"
Changelog = "https://github.com/thewtex/ngff-zarr/releases"

[project.scripts]
ngff-zarr = "ngff_zarr.cli:main"

[tool.hatch.version]
path = "ngff_zarr/__about__.py"

[project.optional-dependencies]
dask-image = ["dask-image"]
itk = ["itk-filtering>=5.3.0"]
cli = [
  "dask-image",
  "dask[distributed]",
  "itk-filtering>=5.3.0",
  "itk-io>=5.3.0",
  "itkwasm-image-io",
  "imageio",
  "tifffile>=2024.7.24",
  "imagecodecs",
]
test = [
  "pytest >=6",
  "pooch",
  "jsonschema",
]
docs = [ "furo>=2024.7.18,<2025", "myst-parser>=3.0.1,<4", "sphinx>=7.4.7,<8", "sphinx-autodoc2>=0.5.0,<0.6", "sphinx-copybutton>=0.5.2,<0.6", "sphinx-design>=0.6.0,<0.7", "sphinxext-opengraph>=0.9.1,<0.10", "sphinx-autobuild>=2024.4.16,<2025"]


[tool.coverage.report]
run.source = ["ngff_zarr"]
report.exclude_lines = [
  "no cov",
  '\.\.\.',
  "if __name__ == .__main__.:",
  "if TYPE_CHECKING:",
]


[tool.pytest.ini_options]
minversion = "6.0"
filterwarnings = [
  "ignore:(ast.Str|Attribute s|ast.NameConstant|ast.Num) is deprecated:DeprecationWarning:_pytest",
]
log_cli_level = "INFO"
testpaths = ["tests"]

[tool.lint]
select = [
  "E",
  "F",
  "W",   # flake8
  "B",   # flake8-bugbear
  "I",   # isort
  "ARG", # flake8-unused-arguments
  "C4",  # flake8-comprehensions
  "EM",  # flake8-errmsg
  "ICN", # flake8-import-conventions
  "ISC", # flake8-implicit-str-concat
  "G",   # flake8-logging-format
  "PGH", # pygrep-hooks
  "PIE", # flake8-pie
  "PL",  # pylint
  "PT",  # flake8-pytest-style
  "PTH", # flake8-use-pathlib
  "RET", # flake8-return
  "RUF", # Ruff-specific
  "SIM", # flake8-simplify
  "T20", # flake8-print
  "UP",  # pyupgrade
  "YTT", # flake8-2020
  "EXE", # flake8-executable
  "NPY", # NumPy specific rules
  "PD",  # pandas-vet
]
extend-ignore = [
  "PLR",  # Design related pylint codes
  "E501", # Line too long
]
unfixable = [
  "T20",  # Removes print statements
  "F841", # Removes unused variables
]
flake8-unused-arguments.ignore-variadic-names = true

[tool.lint.per-file-ignores]
"tests/**" = ["T20"]

[tool.ruff]
src = ["src"]
exclude = []
line-length = 88

[tool.pylint]
py-version = "3.8"
ignore-paths = ["src/ngff_zarr/__about__.py"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
  "design",
  "fixme",
  "line-too-long",
  "missing-module-docstring",
  "wrong-import-position",
]

[tool.black]
line-length = 88

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

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

[tool.pixi.tasks]

[tool.pixi.environments]
default = { solve-group = "default" }
test = { features = ["test", "dask-image", "itk", "cli"], solve-group = "default" }
lint = { features = ["lint"], no-default-feature = true, solve-group = "default" }
docs = { features = ["docs"], no-default-feature = true, solve-group = "default" }
data = { features = ["data"], no-default-feature = true, solve-group = "default" }

[tool.pixi.feature.test.tasks]
test = { cmd = "pytest", description = "Run the test suite" }

[tool.pixi.feature.lint.dependencies]
pre-commit = "*"

[tool.pixi.feature.lint.tasks]
pre-commit-install = { cmd = "pre-commit install", description = "Install pre-commit hooks" }
pre-commit-run = { cmd = "pre-commit run --all", description = "Run pre-commit hooks on all repository files" }
lint = { depends-on = ["pre-commit-run"], description = "Run linters" }

[tool.pixi.feature.docs.tasks]
dev-docs = { cmd = "sphinx-autobuild docs docs/_build/html", description = "Build the documentation" }

[tool.pixi.feature.docs.target.linux-64.tasks]
build-docs = { cmd = "make html", cwd = "docs", description = "Build the documentation" }

[tool.pixi.feature.docs.target.osx-64.tasks]
build-docs = { cmd = "make html", cwd = "docs", description = "Build the documentation" }

[tool.pixi.feature.docs.target.osx-arm64.tasks]
build-docs = { cmd = "make html", cwd = "docs", description = "Build the documentation" }

[tool.pixi.feature.data.dependencies]
python = ">=3.9.19,<4"
pooch = ">=1.8.2,<2"

[tool.pixi.feature.data.tasks]
hash-data = { cmd = "tar cvf ../data.tar * && gzip -9 -f ../data.tar && echo 'New SHA256:' && python3 -c 'import pooch; print(pooch.file_hash(\"../data.tar.gz\"))'", cwd = "test/data", description = "Update the testing data tarball and get its sha256 hash" }
