-
Notifications
You must be signed in to change notification settings - Fork 5
/
pyproject.toml
614 lines (569 loc) · 18 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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
[tool.poetry]
name = "pyrovelocity"
version = "0.3.0"
packages = [{ include = "pyrovelocity", from = "src" }]
description = "A multivariate RNA Velocity model to estimate future cell states with uncertainty using probabilistic modeling with pyro."
authors = ["pyrovelocity team"]
license = "AGPL-3.0-only"
readme = "README.md"
homepage = "https://docs.pyrovelocity.net"
repository = "https://github.com/pinellolab/pyrovelocity"
documentation = "https://docs.pyrovelocity.net"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[tool.poetry.urls]
Changelog = "https://github.com/pinellolab/pyrovelocity/releases"
[tool.poetry.dependencies]
python = ">=3.11, <3.13"
adjusttext = ">=1.1.1"
altair = ">=5.3.0"
anndata = ">=0.10.5"
anyio = ">=4.3.0"
appdirs = ">=1.4.4"
# 0.18.0 adds a dependency on dm-tree = ">=0.1.8"
# whose build is broken and wheel attempts to
# dlopen an undeclared or broken shared library
# on Darwin
arviz = ">=0.17.1"
astropy = ">=6.1.2"
beartype = ">=0.18.5"
# pinning chex>=0.1.82 may be required to avoid
# dm-tree = ">=0.1.8"
# whose build is broken on Darwin
# https://github.com/NixOS/nixpkgs/blob/4e44fb9c2673c5b58c44deb7e05bcf312a5862cf/pkgs/development/python-modules/dm-tree/default.nix#L52
chex = ">=0.1.7"
click = ">=8.1.7"
colorlog = ">=6.7.0"
daft = ">=0.1.2"
diffrax = ">=0.5.0"
diskcache = ">=5.6.1"
duckdb = ">=1.0.0"
einops = ">=0.7.0"
# requires python 3.11
expression = ">=5.0.2"
flax = ">=0.8.1"
frozenlist = { version = ">=1.1.1", python = "<3.12" }
# frozenlist = [
# { version = ">=1.1.1", python = "<3.12" },
# { version = ">=1.4.1", python = ">=3.12" },
# ]
fsspec = ">=2024.3.0"
greenlet = ">=3.0.3"
httpx = ">=0.27.0"
h5py = ">=3.9.0"
ibis-framework = { extras = ["duckdb"], version = ">=9.2.0" }
jax = ">=0.4.23"
jaxlib = ">=0.4.23"
jaxtyping = ">=0.2.25"
leidenalg = ">=0.9.1"
llvmlite = { version = ">=0.41.1", python = "<3.12" }
# llvmlite = [
# { version = ">=0.41.1", python = "<3.12" },
# { version = ">=0.42.0", python = ">=3.12" },
# ]
# Temporarily pin yanked matplotlib 3.9.1
# https://github.com/matplotlib/matplotlib/issues/28551
# for usage with pip installs
matplotlib = ">=3.9.1"
mlflow = ">=2.13.0"
numpyro = ">=0.15.0"
pandas = ">=2.0.0"
plumbum = ">=1.8.2"
polars = ">=0.20.17"
pyarrow = ">=14.0.2"
pydantic = ">=2.8.0"
pyro-ppl = ">=1.9.1"
lightning = ">=2.0.0"
pytorch-lightning = ">=2.0.0"
pyyaml = ">=6.0.1"
returns = ">=0.23.0"
rich = ">=13.7.1"
scanpy = ">=1.10.1"
scikit-learn = ">=1.3.1"
scipy = ">=1.10.1,<1.14.0"
scvelo = ">=0.3.2"
# scvelo = { git = "https://github.com/theislab/scvelo.git", rev = "3fbce6ff6d644a44911091f498efa0c69f6b85b0" }
scvi-tools = ">=1.1.1"
seaborn = ">=0.13.2"
sparse = ">=0.15.4"
statsmodels = ">=0.14.2"
sympy = ">=1.12"
termcolor = ">=2.2.0"
tiledb = ">=0.31.1"
torch = { version = ">=2.1.2", python = "<3.12" }
# torch = [
# { version = ">=2.1.2", python = "<3.12" },
# { version = ">=2.2.0", python = ">=3.12" },
# ]
torchmetrics = ">=1.2.1"
trio = ">=0.26.0"
validators = ">=0.33.0"
vegafusion = ">=1.6.9"
vegafusion-python-embed = ">=1.6.9"
vl-convert-python = ">=1.6.0"
zstandard = ">=0.23.0"
# removed from library at
# cospar = { version = ">=0.1.9", source = "pypi" }
# scikit-misc = ">=0.1.4"
# extras
# annoy = { version = "^1.17.3", optional = true }
black = { version = ">=23.3.0", optional = true }
coverage = { extras = ["toml"], version = ">=6.2", optional = true }
# darglint = { version = ">=1.8.1", optional = true }
dataclasses-json = { version = ">=0.5.7", optional = true }
# dparse = { version = ">=0.5.2", optional = true }
# dvc = { version = ">=3.0", optional = true }
# dvc-gs = { version = ">=2.22.1", optional = true }
dulwich = { version = ">=0.21.7", optional = true }
# flake8 = { version = ">=4.0.1", optional = true }
# flake8-bandit = { version = ">=2.1.2", optional = true, source = "pypi" }
# flake8-bugbear = { version = ">=21.9.2", optional = true }
# flake8-docstrings = { version = ">=1.6.0", optional = true }
# flake8-rst-docstrings = { version = ">=0.2.5", optional = true }
flytekit = { version = ">=1.13.3", optional = true }
furo = { version = ">=2023.5.20", optional = true }
google-api-python-client = { version = ">=2.79.0", optional = true }
hydra-core = { version = ">=1.3.2", optional = true }
hydra-zen = { version = ">=0.12.1", optional = true }
hypothesis = { version = ">=6.71.0", optional = true }
ipython = { version = ">=8.11.0", optional = true }
ipywidgets = { version = ">=8.0.0", optional = true }
# isort = { version = ">=5.10.1", optional = true }
jupyter-cache = { version = ">=0.6.1", optional = true }
# see https://jupyterlab-contrib.github.io/migrate_from_classical.html for extensions
jupyterlab = { version = ">=4.0.9", optional = true }
jupytext = { version = ">=1.16.0", optional = true }
mashumaro = { version = ">=3.10", optional = true }
matplotlib-venn = { version = ">=0.11.9", optional = true }
mypy = { version = ">=0.930", optional = true }
myst-parser = { version = ">=2.0.0", optional = true }
nbconvert = { version = ">=7.14.0", optional = true }
nbformat = { version = ">=5.9.2", optional = true }
nbsphinx = { version = ">=0.9.3", optional = true }
omegaconf = { version = ">=2.3.0", optional = true }
# orjson = { version = ">=3.9.15", optional = true }
papermill = { version = ">=2.4.0", optional = true }
# pep8-naming = { version = ">=0.12.1", optional = true }
# poethepoet = { version = ">=0.16.0", optional = true, source = "pypi" }
pre-commit = { version = ">=2.16.0", optional = true }
pre-commit-hooks = { version = ">=4.1.0", optional = true }
pyensembl = { version = ">=2.3.12", optional = true }
pyfaidx = { version = ">=0.8.1.1", optional = true }
pygments = { version = ">=2.15.0", optional = true }
pytest = { version = ">=6.2.5", optional = true }
pytest-asyncio = { version = ">=0.21.1", optional = true }
pytest-cov = { version = ">=4.0.0", optional = true }
pytest-mock = { version = ">=3.10.0", optional = true }
python-dotenv = { version = ">=1.0.0", optional = true }
# pyupgrade = { version = ">=2.29.1", optional = true }
# pyvis = { version = ">=0.3.2", optional = true }
rich-click = { version = ">=1.7.3", optional = true }
ruff = { version = ">=0.1.5", optional = true }
# safety = { version = ">=1.10.3", optional = true }
sphinx = { version = ">=7.0.1", optional = true }
sphinx-autobuild = { version = ">=2021.3.14", optional = true }
sphinx-autodoc-typehints = { version = ">=1.23.3", optional = true }
sphinx-click = { version = ">=4.4.0", optional = true }
sphinx-copybutton = { version = ">=0.5.2", optional = true }
sphinx-markdown-builder = { version = ">=0.6.6", optional = true }
quartodoc = { version = ">=0.7.2", optional = true }
# statannotations = { version = ">=0.6.0", optional = true }
# typeguard = { version = ">=2.13.3", optional = true }
xdoctest = { extras = ["colors"], version = ">=0.15.10", optional = true }
# Enable with make lock-pip-cpu
# [[tool.poetry.source]]
# name = "pytorch"
# url = "https://download.pytorch.org/whl/cpu"
# priority = "supplemental"
# [tool.poetry.group.cpu]
# optional = true
# [tool.poetry.group.cpu.dependencies]
# # requirements-cpu.txt
# # torch==1.13.1+cpu ; python_version >= ">=3.10" and python_version < "3.11" and (sys_platform == "linux" or platform_system == "Linux")
# # torch==1.13.1 ; python_version >= ">=3.10" and python_version < "3.11" and (sys_platform == "darwin" or platform_system == "Darwin")
# torch = [
# {platform = "linux", version = ">=1.13.1+cpu", source = "pytorch"},
# {platform = "darwin", version = ">=1.13.1", source = "pypi"},
# ]
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
black = { version = ">=23.3.0", extras = ["jupyter"] }
mypy = ">=1.5.1"
pre-commit = ">=2.16.0"
pre-commit-hooks = ">=4.1.0"
pyright = ">=1.1.347"
ruff = ">=0.1.5"
docformatter = { version = ">=1.7.5", extras = ["tomli"] }
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
coverage = { version = ">=6.2", extras = ["toml"] }
hypothesis = ">=6.72.1"
ipython = ">=8.11.0"
# poethepoet = ">=0.19.0"
pygments = ">=2.15.0"
pytest = ">=7.3.1"
pytest-asyncio = ">=0.21.1"
pytest-cov = ">=4.0.0"
pytest-mock = ">=3.10.0"
requests-mock = ">=1.11.0"
xdoctest = ">=1.1.1"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
furo = ">=2023.5.20"
jupyter-cache = ">=0.6.1"
jupyterlab = ">=4.0.9"
jupytext = ">=1.16.0"
myst-parser = ">=2.0.0"
nbsphinx = ">=0.9.3"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = ">=1.23.3"
sphinx-click = ">=4.4.0"
sphinx-copybutton = ">=0.5.2"
sphinx-markdown-builder = ">=0.6.6"
sphinx = ">=7.0.1"
quartodoc = ">=0.7.2"
[tool.poetry.group.workflows]
optional = true
[tool.poetry.group.workflows.dependencies]
dataclasses-json = ">=0.5.7"
dulwich = ">=0.21.7"
flytekit = ">=1.13.0"
google-api-python-client = ">=2.79.0"
google-cloud-storage = ">=2.14.0"
hydra-core = ">=1.3.2"
hydra-zen = ">=0.12.1"
ipywidgets = ">=8.0.0"
jupytext = ">=1.16.0"
mashumaro = ">=3.10"
nbconvert = ">=7.14.0"
nbformat = ">=5.9.2"
omegaconf = ">=2.3.0"
# orjson = ">=3.9.15"
papermill = ">=2.4.0"
pyperclip = ">=1.8.2"
python-dotenv = ">=1.0.0"
rich-click = ">=1.7.3"
[tool.poetry.group.bioinformatics]
optional = true
[tool.poetry.group.bioinformatics.dependencies]
pyensembl = ">=2.3.12"
pyfaidx = ">=0.8.1.1"
[tool.poetry.extras]
bioinformatics = ["pyensembl", "pyfaidx"]
lint = [
"black",
"docformatter",
"mypy",
"pre-commit-hooks",
"pre-commit",
"pygments",
"pyright",
"ruff",
]
test = [
"coverage",
"hypothesis",
"ipython",
# "poethepoet",
"pygments",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"requests-mock",
"xdoctest",
]
docs = [
"furo",
"jupyter-cache",
"jupyterlab",
"jupytext",
"myst-parser",
"nbsphinx",
"quartodoc",
"sphinx-autobuild",
"sphinx-autodoc-typehints",
"sphinx-click",
"sphinx-copybutton",
"sphinx-markdown-builder",
"sphinx",
]
plotting = [
# "annoy",
"matplotlib-venn",
"statannotations",
]
workflows = [
"dataclasses-json",
"dulwich",
"flytekit",
"google-api-python-client",
"hydra-core",
"hydra-zen",
"ipywidgets",
"jupytext",
"mashumaro",
"nbconvert",
"nbformat",
"omegaconf",
# "orjson",
"papermill",
"pyperclip",
"python-dotenv",
"rich-click",
]
[tool.conda-lock]
channels = ['nodefaults', 'pytorch', 'nvidia', 'conda-forge', 'bioconda']
platforms = [
'linux-64',
# 'linux-aarch64',
# 'osx-arm64',
# 'osx-amd64'
]
conda_executor = "mamba"
log_level = "INFO"
virtual_package_spec = "conda/virtual-packages.yml"
[tool.conda-lock.dependencies]
python = ">=3.11, <3.12"
pip = ">=23.2"
fmt = ">=10.2.1,<11.0"
# jax "<0.4.27" required
# when using conda-lock
# due to https://github.com/google/jax/issues/21116
# fixed in jax 0.4.29 but not available on conda-forge
jax = ">=0.4.23,<0.4.27"
jaxlib = ">=0.4.23,<0.4.27"
pydantic = ">=2.1.1"
# scikit-learn requires an upper bound of
# 1.2.0 when using conda-lock due to inconsistent
# dependency bounds on conda-forge and pypi
# scikit-learn = "<1.2.0"
scikit-learn = "<1.2.0"
# poethepoet = { source = "pypi" }
[tool.poe.tasks.conda-lock]
# This assumes conda-lock has been installed
# using pipx since conda-lock is not available
# to the nix flake and has undesirable dependency
# constraints for inclusion with the main package.
cmd = """
$HOME/.local/bin/conda-lock \
--conda mamba \
--kind lock \
--kind env \
--no-dev-dependencies \
--filter-categories \
--category test \
--category workflows \
--virtual-package-spec conda/virtual-packages.yml \
--filename-template "conda/conda-{platform}.lock" \
--lockfile conda/conda-lock.yml \
-f pyproject.toml
"""
help = "Runs conda-lock to generate a conda environment lock file derived from package dependencies."
# WORKAROUND: see EOF
# only on Linux and Windows
# https://github.com/python-poetry/poetry/issues/2613#issuecomment-799693903
[tool.poe.tasks.force-cuda11]
cmd = """
python -m \
pip install \
torch==1.13.1+cu111 \
--extra-index-url https://download.pytorch.org/whl/cu111
"""
help = "Force install torch 1.13.1+cu111 on Linux and Windows."
[tool.poetry.scripts]
pyrovelocity = "pyrovelocity.workflows.cli:main"
pyrovelocity-notebooks = "pyrovelocity.workflows.notebooks:cli"
# Change log_level to "DEBUG" and consider redirecting output to a searchable
# syntax-highlighted file to see all log messages, e.g.
# $ pytest > test.log.py
[tool.pytest.ini_options]
log_level = "INFO"
# We exclude markers associated with slow tests by default
# but run them in CI with the make target `test-cov-xml`
# which overrides this behavior.
addopts = """
-m "not slow and not pyensembl"
-rA
--xdoctest
--disable-warnings
--cov=src/pyrovelocity/
--cov-report=term-missing
--durations=0
"""
asyncio_mode = "strict"
norecursedirs = ["bazel-*", ".direnv", "reproducibility", "scripts"]
markers = [
"pyensembl: Tests that require pyensembl to run.",
"slow: Tests that are slow and should be run separately.",
"integration: Tests that use many library components.",
]
[tool.coverage.paths]
source = ["src/pyrovelocity"]
tests = ["src/pyrovelocity/tests"]
[tool.coverage.run]
source_pkgs = ["pyrovelocity"]
branch = true
parallel = true
omit = [
"scripts/**",
"src/pyrovelocity/**/__init__.py",
"src/pyrovelocity/__main__.py",
"src/pyrovelocity/tests/**",
"src/pyrovelocity/workflows/**",
]
[tool.coverage.report]
show_missing = true
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.docformatter]
black = true
wrap-summaries = 80
wrap-descriptions = 80
recursive = true
in-place = true
diff = true
make-summary-multi-line = true
pre-summary-newline = true
[tool.ruff]
target-version = "py39"
line-length = 80
exclude = ["app", "bazel-*", "reproducibility", "scripts", ".direnv", ".github"]
# select = []
select = [
# "B", # flake8-bugbear
# "BLE", # flake8-blind-except
# "C4", # comprehensions
# "D", # pydocstyle
# "E", # pycodestyle
# "EXE", # flake8-executable
# "F", # pyflakes
# "FA", # flake8-future-annotations
# "G", # flake8-logging-format
# "FLY", # flynt (format string conversion)
# "I", # isort
# "ICN", # flake8-import-conventions
# "INP", # flake8-no-pep420 (implicit namespace packages)
# "ISC", # flake8-implicit-str-concat
# "PGH", # pygrep-hooks
# "PIE", # flake8-pie
# "PL", # pylint
# "RET", # flake8-return
# "RUF", # ruff-specific rules
# "SIM", # flake8-simplify
# "T10", # flake8-debugger
# "T20", # flake8-print
# "TCH", # flake8-type-checking
# "TID", # flake8-tidy-imports
# "UP", # pyupgrade
# "W", # pycodestyle
# "YTT", # flake8-2020
]
ignore = [
"B028", # required stacklevel argument to warn
"B904", # raise from e or raise from None in exception handlers
"C408", # dict(...) as literal
"D100", # public module
"D101", # public class
"D102", # public method
"D103", # public function
"D104", # public package
"D105", # magic methods
"D106", # nested class
"D107", # init
"D202", # blank lines after function docstring
"D203", # blank line before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # Imperative mood
"D402", # First line should not be the function's signature
"D413", # Blank line required after last section
"E501", # line-too-long, this is automatically enforced by ruff format
"E731", # lambda-assignment
"ISC001", # single line implicit string concat, handled by ruff format
"PGH003", # blanket-type-ignore
"PLC0105", # covariant type parameters should have a _co suffix
"PLR0124", # name compared with self, e.g., a == a
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"PLR2004", # forces everything to be a constant
"PLW2901", # overwriting loop variable
"RET504", # unnecessary-assign, these are useful for debugging
"RET505", # superfluous-else-return, stylistic choice
"RET506", # superfluous-else-raise, stylistic choice
"RET507", # superfluous-else-continue, stylistic choice
"RET508", # superfluous-else-break, stylistic choice
"RUF005", # splat instead of concat
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # nested ifs
"SIM108", # convert everything to ternary operator
"SIM114", # combine `if` branches using logical `or` operator
"SIM116", # dictionary instead of `if` statements
"SIM117", # nested with statements
"SIM118", # remove .keys() calls from dictionaries
"SIM300", # yoda conditions
"UP007", # Optional[str] -> str | None
]
unfixable = [
"T201", # print statements
"F401", # unused imports
"RUF100", # unused noqa comments
"F841", # unused variables
]
[tool.ruff.isort]
known-first-party = ["pyrovelocity"]
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"src/pyrovelocity/tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.pyright]
include = ["src"]
exclude = ["**/node_modules", "**/__pycache__", "**/.hypothesis", "**/docs"]
reportUnnecessaryTypeIgnoreComment = true
reportUnnecessaryIsInstance = false
[tool.isort]
profile = "black"
force_single_line = true
lines_after_imports = 2
[tool.mypy]
python_version = ">=3.11"
[[tool.mypy.overrides]]
module = [""]
ignore_missing_imports = true
warn_unreachable = true
pretty = true
show_column_numbers = true
# show_error_codes = true
show_error_context = true
[tool.pydeps]
max_bacon = 3
cluster = true
max_cluster_size = 10
min_cluster_size = 2
keep_target_cluster = true
rankdir = "TB"
no_show = true
show_dot = true
start_color = 15
rmprefix = "pyrovelocity."
exclude = [
"pyrovelocity.workflows.configuration",
"pyrovelocity.logging",
"pyrovelocity.__main__",
"pyrovelocity.tests.*",
"pyrovelocity.workflows.cli",
]
[build-system]
requires = ["poetry-core>=1.6.0"]
build-backend = "poetry.core.masonry.api"