-
Notifications
You must be signed in to change notification settings - Fork 45
/
pyproject.toml
214 lines (197 loc) · 5.03 KB
/
pyproject.toml
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
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
[project]
name = "spatialdata"
description = "Spatial data format."
authors = [
{name = "scverse"},
]
maintainers = [
{name = "scverse", email = "[email protected]"},
]
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.10, <3.13" # include 3.13 once multiscale-spatial-image conflicts are resolved
dynamic= [
"version" # allow version to be set by git tags
]
license = {file = "LICENSE"}
readme = "README.md"
dependencies = [
"anndata>=0.9.1",
"click",
"dask-image",
"dask>=2024.4.1",
"fsspec",
"geopandas>=0.14",
"multiscale_spatial_image>=2.0.2",
"networkx",
"numba",
"numpy",
"ome_zarr>=0.8.4",
"pandas",
"pooch",
"pyarrow",
"rich",
"setuptools",
"shapely>=2.0.1",
"spatial_image>=1.1.0",
"scikit-image",
"scipy",
"typing_extensions>=4.8.0",
"xarray>=2024.10.0",
"xarray-schema",
"xarray-spatial>=0.3.5",
"zarr<3",
]
[project.optional-dependencies]
dev = [
"bump2version",
]
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",
]
test = [
"pytest",
"pytest-cov",
"pytest-mock",
"torch",
]
benchmark = [
"asv",
]
torch = [
"torch"
]
extra = [
"napari-spatialdata[all]",
"spatialdata-plot",
"spatialdata-io",
]
[tool.coverage.run]
source = ["spatialdata"]
omit = [
"**/test_*.py",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
xfail_strict = true
addopts = [
# "-Werror", # if 3rd party libs raise DeprecationWarnings, just use filterwarnings below
"--import-mode=importlib", # allow using test files with same name
"-s" # print output from tests
]
# info on how to use this https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
filterwarnings = [
# "ignore:.*U.*mode is deprecated:DeprecationWarning",
]
[tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
)
'''
[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 = "py310"
[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.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"