Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
336 lines (326 loc) · 10.6 KB
/
Copy pathpyproject.toml
File metadata and controls
336 lines (326 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
[build-system]
build-backend = "hatchling.build"
requires = [ "hatch-vcs", "hatchling" ]
[project]
name = "squidpy"
description = "Spatial Single Cell Analysis in Python"
readme = "README.md"
keywords = [
"bio-informatics",
"image analysis",
"single-cell",
"spatial data analysis",
"spatial transcriptomics",
]
license = "BSD-3-Clause"
maintainers = [
{ name = "Selman Ozleyen", email = "selman.ozleyen@helmholtz-munich.de" },
{ name = "Tim Treis", email = "tim.treis@scverse.org" },
]
authors = [
{ name = "scverse" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: Jupyter",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Visualization",
"Typing :: Typed",
]
dynamic = [
"version", # allow version to be set by git tags
]
dependencies = [
"aiohttp>=3.8.1",
"anndata>=0.9",
"centrosome>=1.2.3",
"cp-measure>=0.2,<0.3",
"cycler>=0.11",
"dask[array,distributed]>=2021.2", # distributed is the only scheduler that forks for GIL-bound featurization
"dask-image>=0.5",
"docrep>=0.3.1",
"fast-array-utils>=1.5", # `types.HasArrayNamespace`
"fsspec>=2021.11",
"imagecodecs>=2025.8.2,<2026",
"legacy-api-wrap>=1.5", # keyword-only args keep accepting old positional calls (#1288)
"matplotlib>=3.3",
"matplotlib-scalebar>=0.8",
"networkx>=2.6",
"numba>=0.56.4",
"numba-progress>=1.1",
"numpy>=1.23",
"omnipath>=1.0.7",
"pandas>=2.1",
"pillow>=8",
"pooch>=1.6",
"pyyaml>=6",
"scanpy>=1.9.3",
"scikit-image>=0.26",
# due to https://github.com/scikit-image/scikit-image/issues/6850 breaks rescale ufunc
"scikit-learn>=0.24",
# dataset registry + downloader now live in scverse-misc
"scverse-misc[datasets]>=0.1.1,<0.2",
"spatialdata>=0.7.2", # 0.7.2 dropped xarray-schema (pkg_resources break, #1115)
"spatialdata-plot>=0.4.1",
"statsmodels>=0.12",
"threadpoolctl>=3", # clamp BLAS/OpenMP per worker in tiled featurization
# https://github.com/scverse/squidpy/issues/526
"tifffile!=2022.4.22",
"tqdm>=4.50.2",
"validators>=0.18.2",
"xarray>=2024.10",
"zarr>=3",
]
optional-dependencies.leiden = [
"leidenalg",
"spatialleiden>=0.4",
]
urls."Bug Tracker" = "https://github.com/scverse/squidpy/issues"
urls.Documentation = "https://squidpy.readthedocs.io"
urls.Home-page = "https://github.com/scverse/squidpy"
urls.Source = "https://github.com/scverse/squidpy"
[dependency-groups]
dev = [
"hatch>=1.9",
"ipykernel",
"ipywidgets",
"jupyterlab",
"jupytext",
"notebook",
"pre-commit>=3",
"ruff",
]
test = [
"coverage[toml]>=7",
# Image-comparison baselines are matplotlib-version-sensitive; matplotlib 3.11.0 (released
# 2026-06-12) shifts scatter/alpha rendering past the RMS tolerance. Cap for tests only
# (the runtime dependency stays open) until the baselines are regenerated against 3.11.
"matplotlib<3.11",
"pytest>=7",
# Just for VS Code
"pytest-cov>=4",
"pytest-mock>=3.5",
"pytest-rerunfailures",
"pytest-timeout>=2.1",
"pytest-xdist>=3",
"scanpy[leiden]",
]
docs = [
"docutils<0.22", # Pin to avoid sphinx-tabs KeyError with backrefs
"ipython",
"ipywidgets>=8",
"myst-nb>=0.17.1",
"nbsphinx>=0.8.1",
"scverse-misc[sphinx]>=0.1.2,<0.2",
"sphinx>=5.3",
"sphinx-autodoc-annotation",
"sphinx-autodoc-typehints>=1.10.3",
"sphinx-copybutton>=0.5",
"sphinx-design",
"sphinx-rtd-theme",
"sphinx-tabs",
"sphinxcontrib-bibtex>=2.3",
"sphinxcontrib-spelling>=7.6.2",
]
[tool.setuptools]
package-dir = { "" = "src" }
include-package-data = true
[tool.setuptools_scm]
[tool.hatch]
version.source = "vcs"
metadata.allow-direct-references = true
build.hooks.vcs.version-file = "_version.py"
build.targets.wheel.packages = [ "src/squidpy" ]
[tool.pixi]
workspace.channels = [ "conda-forge" ]
workspace.platforms = [ "linux-64", "osx-arm64" ]
dependencies.python = ">=3.12"
pypi-dependencies.squidpy = { path = ".", editable = true }
tasks.format = "ruff format ."
tasks.kernel-install = 'python -m ipykernel install --user --name pixi-dev --display-name "squidpy (dev)"'
tasks.lab = "jupyter lab"
tasks.lint = "ruff check ."
tasks.pre-commit = "pre-commit run"
tasks.pre-commit-install = "pre-commit install"
tasks.test = "pytest -v --color=yes --tb=short --durations=10"
feature.py312.dependencies.python = "3.12.*"
feature.py314.dependencies.python = "3.14.*"
environments.default = { features = [ "py314" ], solve-group = "py314" }
environments.dev-py312 = { features = [ "dev", "test", "py312" ], solve-group = "py312" }
environments.dev-py314 = { features = [ "dev", "test", "py314" ], solve-group = "py314" }
environments.docs-py312 = { features = [ "docs", "py312" ], solve-group = "py312" }
environments.docs-py314 = { features = [ "docs", "py314" ], solve-group = "py314" }
environments.test-py314 = { features = [ "test", "py314" ], solve-group = "py314" }
[tool.ruff]
line-length = 120
exclude = [
".git",
".tox",
"__pycache__",
"build",
"dist",
"docs/_build",
"setup.py",
]
format.docstring-code-format = true
lint.select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"E", # pycodestyle
"F", # pyflakes
"I", # isort
# below are not autofixed
"UP", # pyupgrade
"W", # pycodestyle
]
# too many positional arguments: most arguments are keyword-only (#1288)
lint.extend-select = [ "PLR0917" ]
lint.ignore = [
# B008 Do not perform function calls in argument defaults.
"B008",
# B024 Do not use `__class__` for string comparisons.
"B024",
# D100 Missing docstring in public module
"D100",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# D107 Missing docstring in __init__,
"D107",
# Missing blank line before section
"D411",
# line too long -> we accept long comment lines; formatter gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix, i, j, k, l is reasonable indexing notation
"E741",
# PEP 695 generics (`class C[T]` / `def f[T]`) -> deferred to a dedicated rewrite.
# `GraphMatrixT`/`CoordT` are a shared TypeVar pair: defined in `gr.neighbors`, used by a
# module-level `Callable` alias, imported by `gr._build`, and re-exported from the public
# `squidpy.gr` API. ruff cannot autofix the cross-module use (`SpatialNeighborsResult`, which
# imports the TypeVar) and its fix for the local use (`GraphBuilder`) leaves the still-required
# exported TypeVars in place, creating dual same-name definitions. Converting correctly means
# deciding whether to keep exporting `GraphMatrixT` -- a public-API change, not a version bump.
"UP046",
"UP047",
## Flake8 rules not supported by ruff:
# RST201 Block quote ends without a blank line; unexpected unindent.
# "RST201",
# RST301 Unexpected indentation.
# "RST301",
# RST306 Unknown target name.
# "RST306",
# RST203 Definition list ends without a blank line; unexpected unindent.
# "RST203",
# line break before a binary operator -> black does not adhere to PEP8
# "W503",
# line break occured after a binary operator -> black does not adhere to PEP8
# "W504",
# whitespace before : -> black does not adhere to PEP8
# "E203",
# whitespace before : -> black does not adhere to PEP8
# "E203",
# missing whitespace after ,', ';', or ':' -> black does not adhere to PEP8
# "E231",
# continuation line over-indented for hanging indent -> black does not adhere to PEP8
# "E126",
# inline comment should start with '#' -> Scanpy allows them for specific explanations
# "E266",
# format string does contain unindexed parameters
# "P101",
# indentation is not a multiple of 4
# "E111",
# "E114",
]
lint.explicit-preview-rules = true # only the preview rules selected by name, i.e. PLR0917
lint.per-file-ignores."*/__init__.py" = [ "D104", "F401" ]
lint.per-file-ignores.".scripts/ci/download_data.py" = [ "B", "D" ]
# Sphinx calls event handlers with a fixed positional signature
lint.per-file-ignores."docs/*" = [ "B", "D", "PLR0917" ]
lint.per-file-ignores."src/squidpy/_constants/_constants.py" = [ "D101" ]
lint.per-file-ignores."src/squidpy/_constants/_pkg_constants.py" = [ "D101", "D102", "D106" ]
# ImageContainer is left as it is until it is deprecated, positional arguments included
lint.per-file-ignores."src/squidpy/im/_container.py" = [ "PLR0917" ]
lint.per-file-ignores."src/squidpy/im/_feature_mixin.py" = [ "PLR0917" ]
lint.per-file-ignores."src/squidpy/im/_segment.py" = [ "PLR0917" ]
lint.per-file-ignores."src/squidpy/pl/_ligrec.py" = [ "B", "D" ]
lint.per-file-ignores."tests/*" = [ "D", "PLR0917" ]
lint.unfixable = [
"B",
"BLE",
"C4",
"F401", # ... imported but unused
]
# Disallow all relative imports.
lint.flake8-tidy-imports.ban-relative-imports = "all"
lint.isort.required-imports = [ "from __future__ import annotations" ]
lint.preview = true
# "squidpy/*.py" = [ "RST303" ]
[tool.pytest]
addopts = [
"--ignore=docs",
]
filterwarnings = [
"error::numba.NumbaPerformanceWarning",
"ignore::UserWarning",
"ignore::anndata.OldFormatWarning",
"ignore:.*pkg_resources:DeprecationWarning",
]
markers = [
"internet: tests that require internet",
# the below markers are just there because we import from anndata.tests.helpers,
# which means pytest sees them despite us not using them.
"gpu: tests that require GPU",
"array_api: tests that require array-api-compat",
]
python_files = [ "test_*.py" ]
strict = true
testpaths = [ "tests/" ]
[tool.coverage]
run.source = [ "squidpy" ]
run.omit = [
"*/__init__.py",
"*/_version.py",
"tox/*",
]
run.branch = true
run.parallel = true
paths.source = [
"squidpy",
"*/site-packages/squidpy",
]
report.precision = 2
report.exclude_lines = [
"\\#.*pragma:\\s*no.?cover",
"^\\s*raise AssertionError\\b",
"^\\s*raise NotImplementedError\\b",
"^\\s*return NotImplemented\\b",
"^if __name__ == .__main__.:$",
]
report.skip_empty = true
report.show_missing = true
report.sort = "Miss"
[tool.cruft]
skip = [
"tests",
"src/**/__init__.py",
"src/**/basic.py",
"docs/api.md",
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb",
]