-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (192 loc) · 5.29 KB
/
pyproject.toml
File metadata and controls
210 lines (192 loc) · 5.29 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
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
[project]
name = "spatialdata"
description = "Spatial data format."
authors = [
{name = "scverse"},
]
maintainers = [
{name = "scverse", email = "giov.pll@gmail.com"},
]
urls.Documentation = "https://spatialdata.scverse.org/en/latest"
urls.Source = "https://github.com/scverse/spatialdata.git"
urls.Home-page = "https://github.com/scverse/spatialdata.git"
requires-python = ">=3.11"
dynamic= [
"version" # allow version to be set by git tags
]
license = {file = "LICENSE"}
readme = "README.md"
dependencies = [
"anndata>=0.9.1",
"annsel>=0.1.2",
"click",
"dask-image",
"dask>=2025.12.0,<2026.1.2",
"distributed<2026.1.2",
"datashader",
"fsspec[s3,http]",
"geopandas>=0.14",
"multiscale_spatial_image==2.0.3",
"networkx",
"numba>=0.55.0",
"numpy",
"ome_zarr>=0.12.2",
"pandas",
"pooch",
"pyarrow",
"rich",
"setuptools",
"shapely>=2.0.1",
"spatial_image>=1.2.3",
"scikit-image",
"scipy!=1.17.0",
"typing_extensions>=4.8.0",
"universal_pathlib>=0.2.6",
"xarray>=2024.10.0",
"xarray-spatial>=0.3.5",
"zarr>=3.0.0",
]
[project.optional-dependencies]
torch = [
"torch"
]
extra = [
"napari-spatialdata[all]",
"spatialdata-plot",
"spatialdata-io",
]
[dependency-groups]
dev = [
"bump2version",
]
test = [
"pytest",
"pytest-cov",
"pytest-mock",
"torch",
]
docs = [
"sphinx>=4.5",
"sphinx-autobuild",
"sphinx-book-theme>=1.0.0",
"myst-nb",
"sphinxcontrib-bibtex>=1.0.0",
"sphinx-autodoc-typehints",
"sphinx-design",
# For notebooks
"ipython>=8.6.0",
"sphinx-copybutton",
"sphinx-pytest",
]
benchmark = [
"asv",
"memray",
"profimp",
]
[tool.coverage.run]
source = ["spatialdata"]
omit = [
"**/test_*.py",
]
[tool.pytest]
testpaths = ["tests"]
strict = true
addopts = [
"--import-mode=importlib", # allow using test files with same name
"-s", # print output from tests
]
# These are all markers coming from xarray, dask or anndata. Added here to silence warnings.
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"gpu: run test on GPU using CuPY.",
"array_api: used by anndata.tests.helpers, not us",
"skip_with_pyarrow_strings: skipwhen pyarrow string conversion is turned on",
]
# info on how to use this https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
filterwarnings = [
# "error", # if 3rd party libs raise DeprecationWarnings, TODO: filter them individually below
# "ignore:.*U.*mode is deprecated:DeprecationWarning",
]
[tool.jupytext]
formats = "ipynb,md"
[tool.hatch.build.targets.wheel]
packages = ['src/spatialdata']
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "_version.py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.ruff]
exclude = [
".git",
".tox",
"__pycache__",
"build",
"docs/_build",
"dist",
"setup.py",
]
line-length = 120
target-version = "py311"
[tool.ruff.lint]
ignore = [
# 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",
# Missing docstring in public package
"D104",
# Missing docstring in public module
"D100",
# Missing docstring in __init__
"D107",
# Missing docstring in magic method
"D105",
# Do not perform function calls in argument defaults.
"B008",
# Missing docstring in magic method
"D105",
]
select = [
"D", # flake8-docstrings
"I", # isort
"E", # pycodestyle
"F", # pyflakes
"W", # pycodestyle
"Q", # flake8-quotes
"SIM", # flake8-simplify
"TID", # flake-8-tidy-imports
"NPY", # NumPy-specific rules
"PT", # flake8-pytest-style
"B", # flake8-bugbear
"UP", # pyupgrade
"C4", # flake8-comprehensions
"BLE", # flake8-blind-except
"T20", # flake8-print
"RET", # flake8-raise
"PGH", # pygrep-hooks
]
unfixable = ["B", "C4", "UP", "BLE", "T20", "RET"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "PT", "B024"]
"*/__init__.py" = ["F401", "D104", "D107", "E402"]
"docs/*" = ["D","B","E","A"]
"src/spatialdata/transformations/transformations.py" = ["D101","D102", "D106", "B024", "T201", "RET504", "UP006", "UP007"]
"src/spatialdata/transformations/operations.py" = ["D101","D102", "D106", "B024","D401", "T201", "RET504", "RET506", "RET505", "RET504", "UP006", "UP007"]
"src/spatialdata/transformations/ngff/*.py" = ["D101","D102", "D106", "D401", "E501","RET506", "RET505", "RET504", "UP006", "UP007"]
"src/spatialdata/transformations/*" = ["RET", "D", "UP006", "UP007"]
"src/spatialdata/models/models.py" = ["D101", "B026"]
"src/spatialdata/dataloader/datasets.py" = ["D101"]
"tests/test_models/test_models.py" = ["NPY002"]
"tests/conftest.py"= ["E402"]
"benchmarks/*" = ["ALL"]
# pyupgrade typing rewrite TODO: remove at some point from per-file ignore
# "UP006", "UP007"