Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ repos:
rev: v1.9.4
hooks:
- id: biome-format
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down
5 changes: 5 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[formatting]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why put this toml under a . prefix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both taplo.toml and .taplo.toml work, but hiding it in file managers makes things a little cleaner. code editors will still display it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this would happen: tamasfe/taplo#603

array_auto_collapse = false
column_width = 120
compact_arrays = false
indent_string = ' '
22 changes: 11 additions & 11 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[envs.default]
installer = "uv"
features = ["dev"]
features = [ "dev" ]

[envs.docs]
features = ["doc"]
features = [ "doc" ]
scripts.build = "sphinx-build -M html docs docs/_build -W --keep-going {args}"
scripts.open = "python3 -m webbrowser -t docs/_build/html/index.html"
scripts.clean = "git clean -fdX -- {args:docs}"
Expand All @@ -14,21 +14,21 @@ scripts.build = "python3 ci/scripts/towncrier_automation.py {args}"
scripts.clean = "git restore --source=HEAD --staged --worktree -- docs/release-notes"

[envs.hatch-test]
default-args = []
features = ["dev", "test"]
extra-dependencies = ["ipykernel"]
default-args = [ ]
features = [ "dev", "test" ]
extra-dependencies = [ "ipykernel" ]
env-vars.UV_CONSTRAINT = "ci/constraints.txt"
overrides.matrix.deps.env-vars = [
{ if = ["pre"], key = "UV_PRERELEASE", value = "allow" },
{ if = ["min"], key = "UV_CONSTRAINT", value = "ci/constraints.txt ci/min-deps.txt" },
{ if = [ "pre" ], key = "UV_PRERELEASE", value = "allow" },
{ if = [ "min" ], key = "UV_CONSTRAINT", value = "ci/constraints.txt ci/min-deps.txt" },
]
overrides.matrix.deps.pre-install-commands = [
{ if = ["min"], value = "uv run ci/scripts/min-deps.py pyproject.toml --all-extras -o ci/min-deps.txt" },
{ if = [ "min" ], value = "uv run ci/scripts/min-deps.py pyproject.toml --all-extras -o ci/min-deps.txt" },
]
overrides.matrix.deps.python = [
{ if = ["min"], value = "3.11" },
{ if = ["stable", "pre"], value = "3.13" },
{ if = [ "min" ], value = "3.11" },
{ if = [ "stable", "pre" ], value = "3.13" },
]

[[envs.hatch-test.matrix]]
deps = ["stable", "pre", "min"]
deps = [ "stable", "pre", "min" ]
48 changes: 24 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
requires = [ "hatchling", "hatch-vcs" ]

[project]
name = "anndata"
Expand Down Expand Up @@ -49,7 +49,7 @@ dependencies = [
"legacy-api-wrap",
"zarr >=2.15.0, !=3.0.0, !=3.0.1, !=3.0.2, !=3.0.3",
]
dynamic = ["version"]
dynamic = [ "version" ]

[project.urls]
Documentation = "https://anndata.readthedocs.io/"
Expand All @@ -74,14 +74,14 @@ doc = [
"nbsphinx",
"scanpydoc[theme,typehints] >=0.15.1",
"awkward>=2.3",
"IPython", # For syntax highlighting in notebooks
"IPython", # For syntax highlighting in notebooks
"myst_parser",
"sphinx_design>=0.5.0",
"readthedocs-sphinx-search",
# for unreleased changes
"anndata[dev-doc]",
]
dev-doc = ["towncrier>=24.8.0"] # release notes tool
dev-doc = [ "towncrier>=24.8.0" ] # release notes tool
test = [
"loompy>=3.0.5",
"pytest>=8.2,<8.3.4",
Expand All @@ -92,36 +92,36 @@ test = [
"joblib",
"boltons",
"scanpy>=1.10",
"httpx", # For data downloading
"httpx", # For data downloading
"dask[distributed]",
"awkward>=2.3",
"pyarrow",
"pytest_memray",
"pytest-mock",
"anndata[dask]",
]
dev-test = ["pytest-xdist"] # local test speedups
gpu = ["cupy"]
cu12 = ["cupy-cuda12x"]
cu11 = ["cupy-cuda11x"]
dev-test = [ "pytest-xdist" ] # local test speedups
gpu = [ "cupy" ]
cu12 = [ "cupy-cuda12x" ]
cu11 = [ "cupy-cuda11x" ]
# https://github.com/dask/dask/issues/11290
# https://github.com/dask/dask/issues/11752
dask = ["dask[array]>=2023.5.1,!=2024.8.*,!=2024.9.*,<2025.2.0"]
dask = [ "dask[array]>=2023.5.1,!=2024.8.*,!=2024.9.*,<2025.2.0" ]

[tool.hatch.version]
source = "vcs"
raw-options.version_scheme = "release-branch-semver"
[tool.hatch.build.targets.wheel]
packages = ["src/anndata", "src/testing"]
packages = [ "src/anndata", "src/testing" ]

[tool.coverage.run]
data_file = "test-data/coverage"
source_pkgs = ["anndata"]
omit = ["src/anndata/_version.py", "**/test_*.py"]
source_pkgs = [ "anndata" ]
omit = [ "src/anndata/_version.py", "**/test_*.py" ]
[tool.coverage.xml]
output = "test-data/coverage.xml"
[tool.coverage.paths]
source = ["./src", "**/site-packages"]
source = [ "./src", "**/site-packages" ]

[tool.coverage.report]
exclude_also = [
Expand All @@ -147,21 +147,21 @@ filterwarnings_when_strict = [
"default:(Observation|Variable) names are not unique. To make them unique:UserWarning",
"default::scipy.sparse.SparseEfficiencyWarning",
"default::dask.array.core.PerformanceWarning",
"default:anndata will no longer support zarr v2:DeprecationWarning"
"default:anndata will no longer support zarr v2:DeprecationWarning",
]
python_files = "test_*.py"
testpaths = [
"anndata", # docstrings (module name due to --pyargs)
"./tests", # unit tests
"./ci/scripts", # CI script tests
"anndata", # docstrings (module name due to --pyargs)
"./tests", # unit tests
"./ci/scripts", # CI script tests
"./docs/concatenation.rst", # further doctests
]
# For some reason this effects how logging is shown when tests are run
xfail_strict = true
markers = ["gpu: mark test to run on GPU"]
markers = [ "gpu: mark test to run on GPU" ]

[tool.ruff]
src = ["src"]
src = [ "src" ]

[tool.ruff.format]
docstring-code-format = true
Expand Down Expand Up @@ -197,17 +197,17 @@ ignore = [
]
[tool.ruff.lint.per-file-ignores]
# E721 comparing types, but we specifically are checking that we aren't getting subtypes (views)
"tests/test_readwrite.py" = ["E721"]
"tests/test_readwrite.py" = [ "E721" ]
[tool.ruff.lint.isort]
known-first-party = ["anndata"]
required-imports = ["from __future__ import annotations"]
known-first-party = [ "anndata" ]
required-imports = [ "from __future__ import annotations" ]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"subprocess.call".msg = "Use `subprocess.run([…])` instead"
"subprocess.check_call".msg = "Use `subprocess.run([…], check=True)` instead"
"subprocess.check_output".msg = "Use `subprocess.run([…], check=True, capture_output=True)` instead"
"legacy_api_wrap.legacy_api".msg = "Use anndata.compat.old_positionals instead"
[tool.ruff.lint.flake8-type-checking]
exempt-modules = []
exempt-modules = [ ]
strict = true

[tool.codespell]
Expand Down