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

[project]
name = "condastats"
dynamic = ["version"]
description = "Conda package stats CLI"
readme = "README.rst"
license = "BSD-3-Clause"
authors = [
    {name = "Sophia Man Yang"}
]
keywords = ["conda", "statistics", "downloads", "anaconda"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Natural Language :: English",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
]
requires-python = ">=3.10"
dependencies = [
    "numpy>=1.20.0",
    "pandas>=2.0.0",
    "dask>=2024.5.2",
    "pyarrow>=10.0.0",
    "s3fs>=2023.1.0",
    "python-snappy>=0.6.1",
]

[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
doc = ["sphinx", "conda-sphinx-theme", "sphinx-copybutton", "sphinx-design"]

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

[project.urls]
Homepage = "https://github.com/conda-incubator/condastats"
Documentation = "https://condastats.readthedocs.io"
Repository = "https://github.com/conda-incubator/condastats"
Changelog = "https://github.com/conda-incubator/condastats/blob/main/CHANGELOG.md"
Issues = "https://github.com/conda-incubator/condastats/issues"

[tool.setuptools]
packages = ["condastats"]

[tool.setuptools_scm]

# ---------------------------------------------------------------------------
# Pixi
# ---------------------------------------------------------------------------

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

[tool.pixi.dependencies]
# Conda dependencies — these override the pypi versions from [project.dependencies]
python = ">=3.10"
numpy = ">=1.20.0"
pandas = ">=2.0.0"
dask = ">=2024.5.2"
pyarrow = ">=10.0.0"
s3fs = ">=2023.1.0"
python-snappy = ">=0.6.1"

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

[tool.pixi.tasks]
test = "pytest -v --cov=condastats --cov-report=term-missing"
lint = "ruff check ."
format = "ruff format ."
format-check = "ruff format --check ."
docs = { cmd = "sphinx-build -M dirhtml source _build", cwd = "docs" }

# -- Features ---------------------------------------------------------------

[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"

[tool.pixi.feature.lint.dependencies]
ruff = "*"

[tool.pixi.feature.docs.dependencies]
sphinx = "*"
conda-sphinx-theme = "*"
sphinx-copybutton = "*"
sphinx-design = "*"

[tool.pixi.feature.py310.dependencies]
python = "3.10.*"

[tool.pixi.feature.py311.dependencies]
python = "3.11.*"

[tool.pixi.feature.py312.dependencies]
python = "3.12.*"

[tool.pixi.feature.py313.dependencies]
python = "3.13.*"

[tool.pixi.feature.py314.dependencies]
python = "3.14.*"

# -- Environments ------------------------------------------------------------

[tool.pixi.environments]
lint = { features = ["lint"], solve-group = "default" }
docs = { features = ["docs"], solve-group = "default" }
test-py310 = { features = ["test", "py310"], solve-group = "py310" }
test-py311 = { features = ["test", "py311"], solve-group = "py311" }
test-py312 = { features = ["test", "py312"], solve-group = "py312" }
test-py313 = { features = ["test", "py313"], solve-group = "py313" }
test-py314 = { features = ["test", "py314"], solve-group = "py314" }

# ---------------------------------------------------------------------------
# Pytest
# ---------------------------------------------------------------------------

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

# ---------------------------------------------------------------------------
# Ruff
# ---------------------------------------------------------------------------

[tool.ruff]
target-version = "py310"

[tool.ruff.lint]
select = [
    "E",    # pycodestyle errors
    "F",    # pyflakes
    "I",    # isort
    "UP",   # pyupgrade
    "W",    # pycodestyle warnings
]

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