-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
361 lines (328 loc) · 8.94 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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
[build-system]
requires = ["setuptools>=61", "setuptools-scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "moscot"
dynamic = ["version"]
description = "Multi-omic single-cell optimal transport tools"
readme = "README.rst"
requires-python = ">=3.10"
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Typing :: Typed",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Mathematics"
]
keywords = [
"single-cell",
"bio-informatics",
"optimal transport"
]
authors = [
{name = "Dominik Klein"},
{name = "Giovanni Palla"},
{name = "Michal Klein"},
{name = "Zoe Piran"},
{name = "Marius Lange"},
]
maintainers = [
{name = "Dominik Klein", email = "[email protected]"},
{name = "Giovanni Palla", email = "[email protected]"},
{name = "Michal Klein", email = "[email protected]"}
]
dependencies = [
"numpy>=1.20.0",
"scipy>=1.7.0",
"pandas>=2.0.1",
"networkx>=3.2",
# https://github.com/scverse/scanpy/issues/2411
"matplotlib>=3.5.0",
"anndata>=0.9.1",
"scanpy>=1.9.3",
"wrapt>=1.13.2",
"docrep>=0.3.2",
"ott-jax[neural]>=0.4.6,<=0.4.8",
"cloudpickle>=2.2.0",
"rich>=13.5",
"docstring_inheritance>=2.0.0",
"mudata>=0.2.2"
]
[project.optional-dependencies]
spatial = [
"squidpy>=1.2.3"
]
neural = [
"optax",
"flax",
"diffrax",
]
dev = [
"pre-commit>=3.0.0",
"tox>=4",
]
test = [
"pytest>=7",
"pytest-xdist>=3",
"pytest-mock>=3.5.0",
"pytest-cov>=4",
"coverage[toml]>=7",
]
docs = [
"sphinx>=5.1.1",
"sphinx_copybutton>=0.5.0",
"sphinxcontrib-bibtex>=2.3.0",
"sphinxcontrib-spelling>=7.6.2",
"sphinx-autodoc-typehints",
"furo>=2022.09.29",
"sphinx-tippy>=0.4.1",
"myst-nb>=0.17.1",
"ipython>=7.20.0",
"sphinx_design>=0.3.0",
]
[project.urls]
Homepage = "https://github.com/theislab/moscot"
Download = "https://moscot.readthedocs.io/en/latest/installation.html"
"Bug Tracker" = "https://github.com/theislab/moscot/issues"
Documentation = "https://moscot.readthedocs.io"
"Source Code" = "https://github.com/theislab/moscot"
[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = true
[tool.setuptools_scm]
[tool.ruff]
exclude = [
".git",
"__pycache__",
"build",
"docs/_build",
"dist"
]
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",
# Use `X | Y` for type annotations
"UP007",
]
line-length = 120
select = [
"D", # flake8-docstrings
# TODO(michalk8): enable this in https://github.com/theislab/moscot/issues/483
# "I", # isort
"E", # pycodestyle
"F", # pyflakes
"W", # pycodestyle
"Q", # flake8-quotes
"SIM", # flake8-simplify
"NPY", # NumPy-specific rules
"PT", # flake8-pytest-style
"TID", # flake8-tidy-imports
"B", # flake8-bugbear
"UP", # pyupgrade
"C4", # flake8-comprehensions
"BLE", # flake8-blind-except
"T20", # flake8-print
"RET", # flake8-raise
]
unfixable = ["B", "UP", "C4", "BLE", "T20", "RET"]
target-version = "py38"
[tool.ruff.per-file-ignores]
"tests/*" = ["D"]
"*/__init__.py" = ["F401"]
"docs/*" = ["D"]
"src/moscot/constants.py" = ["D101"]
"src/moscot/utils/subset_policy.py" = ["D101", "D102"]
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.flake8-quotes]
inline-quotes = "double"
[tool.black]
line-length = 120
target-version = ['py38']
include = '\.pyi?$'
[tool.isort]
profile = "black"
include_trailing_comma = true
multi_line_output = 3
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "GENERIC", "NUMERIC", "PLOTTING", "BIO", "FIRSTPARTY", "LOCALFOLDER"]
# also contains what we import in notebooks
known_generic = ["wrapt", "joblib"]
known_numeric = ["numpy", "scipy", "jax", "ott", "pandas", "sklearn", "networkx", "statsmodels"]
known_bio = ["anndata", "scanpy", "squidpy"]
known_plotting = ["IPython", "matplotlib", "mpl_toolkits", "seaborn"]
[tool.pytest.ini_options]
markers = ["fast: marks tests as fask"]
xfail_strict = true
filterwarnings = [
"ignore:No data for colormapping:UserWarning",
"ignore:The dtype argument will be deprecated in anndata:PendingDeprecationWarning"
]
[tool.coverage.run]
branch = true
parallel = true
source = ["src/"]
omit = [
"*/__init__.py",
"*/_version.py",
]
[tool.coverage.report]
exclude_lines = [
'\#.*pragma:\s*no.?cover',
"^if __name__ == .__main__.:$",
'^\s*raise AssertionError\b',
'^\s*raise NotImplementedError\b',
'^\s*return NotImplemented\b',
]
precision = 2
show_missing = true
skip_empty = true
sort = "Miss"
[tool.rstcheck]
ignore_directives = [
"toctree",
"currentmodule",
"autosummary",
"module",
"automodule",
"autoclass",
"bibliography",
"glossary",
"card",
"grid",
]
ignore_roles = [
"mod",
]
[tool.mypy]
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
python_version = "3.10"
plugins = "numpy.typing.mypy_plugin"
ignore_errors = false
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
disallow_untyped_calls = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_any_generics = true
strict_optional = true
strict_equality = true
warn_return_any = false
warn_unreachable = false
check_untyped_defs = true
no_implicit_optional = true
no_implicit_reexport = true
no_warn_no_return = true
show_error_codes = true
show_column_numbers = true
error_summary = true
ignore_missing_imports = true
disable_error_code = ["assignment", "comparison-overlap", "no-untyped-def", "override"]
[tool.doc8]
max_line_length = 120
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4.0
env_list = lint-code,py{3.10,3.11,3.12}
skip_missing_interpreters = true
[testenv]
extras = test
commands =
python -m pytest {tty:--color=yes} {posargs: \
--cov={env_site_packages_dir}{/}moscot --cov-config={tox_root}{/}pyproject.toml \
--no-cov-on-fail --cov-report=xml --cov-report=term-missing:skip-covered}
passenv = PYTEST_*,CI
[testenv:lint-code]
description = Lint the code.
deps = pre-commit>=3.0.0
skip_install = true
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:lint-docs]
description = Lint the documentation.
extras = docs
ignore_errors = true
allowlist_externals = make
pass_env = PYENCHANT_LIBRARY_PATH
set_env = SPHINXOPTS = -W -q --keep-going
changedir = {tox_root}{/}docs
commands =
make linkcheck {posargs}
# TODO(michalk8): uncomment after https://github.com/theislab/moscot/issues/490
# make spelling {posargs}
[testenv:examples-docs]
allowlist_externals = bash
description = Run the notebooks.
use_develop = true
deps =
ipykernel
jupytext
nbconvert
leidenalg
extras = docs
changedir = {tox_root}{/}docs
commands =
python -m ipykernel install --user --name=moscot
bash {tox_root}/.run_notebooks.sh {tox_root}{/}docs/notebooks
[testenv:clean-docs]
description = Remove the documentation.
deps =
skip_install = true
changedir = {tox_root}{/}docs
allowlist_externals = make
commands =
make clean
[testenv:build-docs]
description = Build the documentation.
deps =
extras = docs
allowlist_externals = make
changedir = {tox_root}{/}docs
commands =
make html {posargs}
commands_post =
python -c 'import pathlib; print("Documentation is under:", pathlib.Path("{tox_root}") / "docs" / "_build" / "html" / "index.html")'
[testenv:build-package]
description = Build the package.
deps =
build
twine
allowlist_externals = rm
commands =
rm -rf {tox_root}{/}dist
python -m build --sdist --wheel --outdir {tox_root}{/}dist{/} {posargs:}
python -m twine check {tox_root}{/}dist{/}*
commands_post =
python -c 'import pathlib; print(f"Package is under:", pathlib.Path("{tox_root}") / "dist")'
[testenv:format-references]
description = Format references.bib.
deps =
skip_install = true
allowlist_externals = biber
commands = biber --tool --output_file={tox_root}{/}docs{/}references.bib --nolog \
--output_align --output_indent=2 --output_fieldcase=lower \
--output_legacy_dates --output-field-replace=journaltitle:journal,thesis:phdthesis,institution:school \
{tox_root}{/}docs{/}references.bib
"""