-
Notifications
You must be signed in to change notification settings - Fork 627
/
Copy pathpyproject.toml
315 lines (303 loc) · 12 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
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
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling", "hatch-vcs" ]
[project]
name = "scanpy"
description = "Single-Cell Analysis in Python."
requires-python = ">=3.11"
license = "BSD-3-clause"
authors = [
{ name = "Alex Wolf" },
{ name = "Philipp Angerer" },
{ name = "Fidel Ramirez" },
{ name = "Isaac Virshup" },
{ name = "Sergei Rybakov" },
{ name = "Gokcen Eraslan" },
{ name = "Tom White" },
{ name = "Malte Luecken" },
{ name = "Davide Cittaro" },
{ name = "Tobias Callies" },
{ name = "Marius Lange" },
{ name = "Andrés R. Muñoz-Rojas" },
]
maintainers = [
{ name = "Philipp Angerer", email = "phil.angerer@gmail.com" },
{ name = "Ilan Gold", email = "ilan.gold@helmholtz-munich.de" },
{ name = "Severin Dicks" },
]
readme = "README.md"
classifiers = [
"License :: OSI Approved :: BSD License",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: Jupyter",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Visualization",
]
dependencies = [
"anndata>=0.9",
"numpy>=1.25",
"matplotlib>=3.7",
"pandas >=2.0",
"scipy>=1.11",
"seaborn>=0.13",
"h5py>=3.8",
"tqdm",
"scikit-learn>=1.1",
"statsmodels>=0.14",
"patsy!=1.0.0", # https://github.com/pydata/patsy/issues/215
"networkx>=2.8",
"natsort",
"joblib",
"numba>=0.58",
"umap-learn>=0.5,!=0.5",
"pynndescent>=0.5",
"packaging>=21.3",
"session-info2",
"legacy-api-wrap>=1.4", # for positional API deprecations
"typing-extensions; python_version < '3.13'",
]
dynamic = [ "version" ]
# https://docs.pypi.org/project_metadata/#project-urls
[project.urls]
Documentation = "https://scanpy.readthedocs.io/"
Source = "https://github.com/scverse/scanpy"
Homepage = "https://scanpy.org"
Discourse = "https://discourse.scverse.org/c/help/scanpy/37"
Bluesky = "https://bsky.app/profile/scverse.bsky.social"
Twitter = "https://x.com/scverse_team"
[project.scripts]
scanpy = "scanpy.cli:console_main"
[project.optional-dependencies]
test-min = [
"pytest>=8.2",
"pytest-mock",
"pytest-cov",
"pytest-xdist[psutil]",
"pytest-randomly",
"pytest-rerunfailures",
"profimp",
]
test = [
"scanpy[test-min]",
# Optional but important dependencies
"scanpy[leiden]",
"zarr<3",
"scanpy[dask]",
"scanpy[scrublet]",
]
test-full = [
"scanpy[test]",
# optional storage modes
"zappy",
# additional tested algorithms
"scanpy[louvain]",
"scanpy[magic]",
"scanpy[skmisc]",
"scanpy[harmony]",
"scanpy[scanorama]",
"scanpy[dask-ml]",
]
doc = [
"sphinx >=7, !=8.2.0",
"sphinx-book-theme>=1.1.0",
"scanpydoc>=0.15.3",
"sphinx-autodoc-typehints>=1.25.2",
"myst-parser>=2",
"myst-nb>=1",
"sphinx-design",
"sphinx-tabs",
"sphinxext-opengraph", # for nice cards when sharing on social
"sphinx-copybutton",
"nbsphinx>=0.9",
"ipython>=7.20", # for nbsphinx code highlighting
"matplotlib!=3.6.1",
"sphinxcontrib-bibtex",
"setuptools", # undeclared dependency of sphinxcontrib-bibtex→pybtex
# TODO: remove necessity for being able to import doc-linked classes
"scanpy[paga,dask-ml]",
"sam-algorithm",
]
dev = [
"hatch-vcs", # runtime dev version generation
"pre-commit", # static checking
"towncrier", # release note management
]
# Algorithms
paga = [ "igraph" ]
louvain = [ "igraph", "louvain>=0.6.0,!=0.6.2" ] # Louvain community detection
leiden = [ "igraph>=0.10", "leidenalg>=0.9.0" ] # Leiden community detection
bbknn = [ "bbknn" ] # Batch balanced KNN (batch correction)
magic = [ "magic-impute>=2.0" ] # MAGIC imputation method
skmisc = [ "scikit-misc>=0.1.3" ] # highly_variable_genes method 'seurat_v3'
harmony = [ "harmonypy" ] # Harmony dataset integration
scanorama = [ "scanorama" ] # Scanorama dataset integration
scrublet = [ "scikit-image>=0.20" ] # Doublet detection with automatic thresholds
# Acceleration
rapids = [ "cudf>=0.9", "cuml>=0.9", "cugraph>=0.9" ] # GPU accelerated calculation of neighbors
dask = [ "dask[array]>=2023.5.1" ] # Use the Dask parallelization engine
dask-ml = [ "dask-ml", "scanpy[dask]" ] # Dask-ML for sklearn-like API
[tool.hatch.build.targets.wheel]
packages = [ "src/testing", "src/scanpy" ]
[tool.hatch.version]
source = "vcs"
raw-options.version_scheme = "release-branch-semver"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--strict-markers",
"--doctest-modules",
"-ptesting.scanpy._pytest",
"--pyargs",
]
testpaths = [ "./tests", "./ci", "scanpy" ]
norecursedirs = [ "tests/_images" ]
xfail_strict = true
junit_family = "xunit1"
markers = [
"internet: tests which rely on internet resources (enable with `--internet-tests`)",
"gpu: tests that use a GPU (currently unused, but needs to be specified here as we import anndata.tests.helpers, which uses it)",
"anndata_dask_support: tests that require dask support in anndata",
]
filterwarnings = [
# legacy-api-wrap: internal use of positional API
"error:The specified parameters:FutureWarning",
# When calling `.show()` in tests, this is raised
"ignore:FigureCanvasAgg is non-interactive:UserWarning",
# We explicitly handle the below errors in tests
"error:`anndata.read` is deprecated:FutureWarning",
"error:Observation names are not unique:UserWarning",
"error:The dtype argument is deprecated and will be removed:FutureWarning",
"error:The behavior of DataFrame\\.sum with axis=None is deprecated:FutureWarning",
"error:The default of observed=False is deprecated:FutureWarning",
"error:Series\\.__getitem__ treating keys as positions is deprecated:FutureWarning",
"error:The default value of 'ignore' for the `na_action` parameter in pandas\\.Categorical\\.map:FutureWarning",
"error:The provided callable.* is currently using:FutureWarning",
"error:The behavior of DataFrame concatenation with empty or all-NA entries is deprecated:FutureWarning",
"error:A value is trying to be set on a copy of a slice from a DataFrame",
"error:No data for colormapping provided via 'c'",
"error:\\n*The `scale` parameter has been renamed and will be removed",
"error:\\n*Passing `palette` without assigning `hue` is deprecated",
"error:\\n*Setting a gradient palette using color= is deprecated",
]
[tool.coverage.run]
data_file = "test-data/coverage"
source_pkgs = [ "scanpy" ]
omit = [ "tests/*", "src/testing/*" ]
concurrency = [ "multiprocessing" ]
parallel = "true"
[tool.coverage.xml]
output = "test-data/coverage.xml"
[tool.coverage.paths]
source = [ ".", "**/site-packages" ]
[tool.coverage.report]
exclude_also = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
# https://github.com/numba/numba/issues/4268
'@(numba\.|nb\.)njit.*',
]
[tool.ruff]
src = [ "src" ]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
"B", # Likely bugs and design issues
"BLE", # Blind exception raised
"C4", # Comprehensions
"D", # Documentation style
"E", # Error detected by Pycodestyle
"EM", # Traceback-friendly error messages
"F", # Errors detected by Pyflakes
"FBT", # No positional boolean parameters
"I", # Import sorting
"ICN", # Follow import conventions
"ISC", # Implicit string concatenation
"PERF", # Performance
"PIE", # Syntax simplifications
"PL", # Pylint
"PT", # Pytest style
"PTH", # Pathlib instead of os.path
"PYI", # Typing
"RUF", # Miscellaneous Ruff-only lints
"SIM", # Simplify control flow
"TC", # Manage type checking blocks
"UP", # Update legacy syntax
"TID251", # Banned imports
"W", # Warning detected by Pycodestyle
]
external = [ "PLR0917" ] # preview lint that we use
ignore = [
"C408", # dict() syntax is preferrable when creating dicts for kwargs
"E262", # E266 too many leading '#' for block comment -> Scanpy allows them for comments into sections
"E402", # module level import not at top of file -> required to circumvent circular imports for Scanpys API
"E501", # line too long -> we accept long comment lines; black gets rid of long code lines
"E741", # allow I, O, l as variable names -> I is the identity matrix, i, j, k, l is reasonable indexing notation
"D203", # We ban blank lines before docstrings instead of the opposite
"D213", # We want multiline summaries to start on the first line, not the second
"D417", # TODO: replace our current param docs reuse with this and remove it here:
"PLR2004", # Numbers like “2” aren’t that “magic”.
"PYI051", # `Literal["..."] | str` is useful for autocompletion
]
allowed-confusables = [ "×", "’", "–", "α" ]
[tool.ruff.lint.per-file-ignores]
# Do not assign a lambda expression, use a def
"src/scanpy/tools/_rank_genes_groups.py" = [ "E731" ]
# No need for docstrings for all benchmarks
"benchmarks/**/*.py" = [ "D102", "D103" ]
# D*: No need for docstrings for all test modules and test functions
# PLR0913: Test may use many fixtures
"tests/**/*.py" = [ "D100", "D101", "D103", "PLR0913" ]
[tool.ruff.lint.isort]
known-first-party = [ "scanpy", "testing.scanpy" ]
required-imports = [ "from __future__ import annotations" ]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pytest.importorskip".msg = "Use the “@needs” decorator/mark instead"
"pandas.api.types.is_categorical_dtype".msg = "Use isinstance(s.dtype, CategoricalDtype) instead"
"pandas.value_counts".msg = "Use pd.Series(a).value_counts() instead"
"scipy.sparse.spmatrix".msg = "Use _compat.SpBase instead"
"scipy.sparse.sparray".msg = "Use _compat.SpBase instead"
"scipy.sparse.csr_matrix".msg = "Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing"
"scipy.sparse.csc_matrix".msg = "Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing"
"scipy.sparse.csr_array".msg = "Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing"
"scipy.sparse.csc_array".msg = "Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing"
"scipy.sparse.issparse".msg = "Use isinstance(_, _compat.CSBase) or isinstance(_, _compat.SpBase) instead"
"legacy_api_wrap.legacy_api".msg = "Use scanpy._compat.old_positionals instead"
"numpy.bool".msg = "Use `np.bool_` instead for numpy>=1.24<2 compatibility"
"numba.jit".msg = "Use `scanpy._compat.njit` instead"
"numba.njit".msg = "Use `scanpy._compat.njit` instead"
[tool.ruff.lint.flake8-type-checking]
exempt-modules = [ ]
strict = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
max-args = 10
max-positional-args = 5
[tool.towncrier]
name = "scanpy"
package = "scanpy"
directory = "docs/release-notes"
filename = "docs/release-notes/{version}.md"
single_file = false
package_dir = "src"
issue_format = "{{pr}}`{issue}`"
title_format = "(v{version})=\n### {version} {{small}}`{project_date}`"
fragment.bugfix.name = "Bug fixes"
fragment.doc.name = "Documentation"
fragment.feature.name = "Features"
fragment.misc.name = "Miscellaneous improvements"
fragment.performance.name = "Performance"
fragment.breaking.name = "Breaking changes"
fragment.dev.name = "Development Process"