Skip to content

Commit fbf739e

Browse files
authored
Format TOML with taplo (#1898)
1 parent 9a0b981 commit fbf739e

4 files changed

Lines changed: 44 additions & 35 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ repos:
99
rev: v1.9.4
1010
hooks:
1111
- id: biome-format
12+
- repo: https://github.com/ComPWA/taplo-pre-commit
13+
rev: v0.9.3
14+
hooks:
15+
- id: taplo-format
1216
- repo: https://github.com/pre-commit/pre-commit-hooks
1317
rev: v5.0.0
1418
hooks:

.taplo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[formatting]
2+
array_auto_collapse = false
3+
column_width = 120
4+
compact_arrays = false
5+
indent_string = ' '

hatch.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[envs.default]
22
installer = "uv"
3-
features = ["dev"]
3+
features = [ "dev" ]
44

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

1616
[envs.hatch-test]
17-
default-args = []
18-
features = ["dev", "test"]
19-
extra-dependencies = ["ipykernel"]
17+
default-args = [ ]
18+
features = [ "dev", "test" ]
19+
extra-dependencies = [ "ipykernel" ]
2020
env-vars.UV_CONSTRAINT = "ci/constraints.txt"
2121
overrides.matrix.deps.env-vars = [
22-
{ if = ["pre"], key = "UV_PRERELEASE", value = "allow" },
23-
{ if = ["min"], key = "UV_CONSTRAINT", value = "ci/constraints.txt ci/min-deps.txt" },
22+
{ if = [ "pre" ], key = "UV_PRERELEASE", value = "allow" },
23+
{ if = [ "min" ], key = "UV_CONSTRAINT", value = "ci/constraints.txt ci/min-deps.txt" },
2424
]
2525
overrides.matrix.deps.pre-install-commands = [
26-
{ if = ["min"], value = "uv run ci/scripts/min-deps.py pyproject.toml --all-extras -o ci/min-deps.txt" },
26+
{ if = [ "min" ], value = "uv run ci/scripts/min-deps.py pyproject.toml --all-extras -o ci/min-deps.txt" },
2727
]
2828
overrides.matrix.deps.python = [
29-
{ if = ["min"], value = "3.11" },
30-
{ if = ["stable", "pre"], value = "3.13" },
29+
{ if = [ "min" ], value = "3.11" },
30+
{ if = [ "stable", "pre" ], value = "3.13" },
3131
]
3232

3333
[[envs.hatch-test.matrix]]
34-
deps = ["stable", "pre", "min"]
34+
deps = [ "stable", "pre", "min" ]

pyproject.toml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
build-backend = "hatchling.build"
3-
requires = ["hatchling", "hatch-vcs"]
3+
requires = [ "hatchling", "hatch-vcs" ]
44

55
[project]
66
name = "anndata"
@@ -49,7 +49,7 @@ dependencies = [
4949
"legacy-api-wrap",
5050
"zarr >=2.15.0, !=3.0.0, !=3.0.1, !=3.0.2, !=3.0.3",
5151
]
52-
dynamic = ["version"]
52+
dynamic = [ "version" ]
5353

5454
[project.urls]
5555
Documentation = "https://anndata.readthedocs.io/"
@@ -74,14 +74,14 @@ doc = [
7474
"nbsphinx",
7575
"scanpydoc[theme,typehints] >=0.15.1",
7676
"awkward>=2.3",
77-
"IPython", # For syntax highlighting in notebooks
77+
"IPython", # For syntax highlighting in notebooks
7878
"myst_parser",
7979
"sphinx_design>=0.5.0",
8080
"readthedocs-sphinx-search",
8181
# for unreleased changes
8282
"anndata[dev-doc]",
8383
]
84-
dev-doc = ["towncrier>=24.8.0"] # release notes tool
84+
dev-doc = [ "towncrier>=24.8.0" ] # release notes tool
8585
test = [
8686
"loompy>=3.0.5",
8787
"pytest>=8.2,<8.3.4",
@@ -92,36 +92,36 @@ test = [
9292
"joblib",
9393
"boltons",
9494
"scanpy>=1.10",
95-
"httpx", # For data downloading
95+
"httpx", # For data downloading
9696
"dask[distributed]",
9797
"awkward>=2.3",
9898
"pyarrow",
9999
"pytest_memray",
100100
"pytest-mock",
101101
"anndata[dask]",
102102
]
103-
dev-test = ["pytest-xdist"] # local test speedups
104-
gpu = ["cupy"]
105-
cu12 = ["cupy-cuda12x"]
106-
cu11 = ["cupy-cuda11x"]
103+
dev-test = [ "pytest-xdist" ] # local test speedups
104+
gpu = [ "cupy" ]
105+
cu12 = [ "cupy-cuda12x" ]
106+
cu11 = [ "cupy-cuda11x" ]
107107
# https://github.com/dask/dask/issues/11290
108108
# https://github.com/dask/dask/issues/11752
109-
dask = ["dask[array]>=2023.5.1,!=2024.8.*,!=2024.9.*,<2025.2.0"]
109+
dask = [ "dask[array]>=2023.5.1,!=2024.8.*,!=2024.9.*,<2025.2.0" ]
110110

111111
[tool.hatch.version]
112112
source = "vcs"
113113
raw-options.version_scheme = "release-branch-semver"
114114
[tool.hatch.build.targets.wheel]
115-
packages = ["src/anndata", "src/testing"]
115+
packages = [ "src/anndata", "src/testing" ]
116116

117117
[tool.coverage.run]
118118
data_file = "test-data/coverage"
119-
source_pkgs = ["anndata"]
120-
omit = ["src/anndata/_version.py", "**/test_*.py"]
119+
source_pkgs = [ "anndata" ]
120+
omit = [ "src/anndata/_version.py", "**/test_*.py" ]
121121
[tool.coverage.xml]
122122
output = "test-data/coverage.xml"
123123
[tool.coverage.paths]
124-
source = ["./src", "**/site-packages"]
124+
source = [ "./src", "**/site-packages" ]
125125

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

163163
[tool.ruff]
164-
src = ["src"]
164+
src = [ "src" ]
165165

166166
[tool.ruff.format]
167167
docstring-code-format = true
@@ -197,17 +197,17 @@ ignore = [
197197
]
198198
[tool.ruff.lint.per-file-ignores]
199199
# E721 comparing types, but we specifically are checking that we aren't getting subtypes (views)
200-
"tests/test_readwrite.py" = ["E721"]
200+
"tests/test_readwrite.py" = [ "E721" ]
201201
[tool.ruff.lint.isort]
202-
known-first-party = ["anndata"]
203-
required-imports = ["from __future__ import annotations"]
202+
known-first-party = [ "anndata" ]
203+
required-imports = [ "from __future__ import annotations" ]
204204
[tool.ruff.lint.flake8-tidy-imports.banned-api]
205205
"subprocess.call".msg = "Use `subprocess.run([…])` instead"
206206
"subprocess.check_call".msg = "Use `subprocess.run([…], check=True)` instead"
207207
"subprocess.check_output".msg = "Use `subprocess.run([…], check=True, capture_output=True)` instead"
208208
"legacy_api_wrap.legacy_api".msg = "Use anndata.compat.old_positionals instead"
209209
[tool.ruff.lint.flake8-type-checking]
210-
exempt-modules = []
210+
exempt-modules = [ ]
211211
strict = true
212212

213213
[tool.codespell]

0 commit comments

Comments
 (0)