Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
239 lines (221 loc) · 7.89 KB
/
Copy pathpyproject.toml
File metadata and controls
239 lines (221 loc) · 7.89 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
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
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling" ]
[project]
name = "alphapepttools"
description = "Search- and quantification-engine agnostic biological interpretation of proteomics data"
readme = "README.md"
license = { file = "LICENSE" }
maintainers = [
{ name = "MannLabs", email = "brennsteiner@biochem.mpg.de" },
]
authors = [
{ name = "MannLabs" },
]
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = [ "version" ]
dependencies = [
"alphabase",
"anndata",
"bpca>=0.1",
"cmcrameri", # TODO: remove this to optional dependencies?
"matplotlib>=3.10.5", # 3.10.5 contains a critical fix (https://github.com/matplotlib/matplotlib/pull/30217) to make matplotlib compatible with python 3.14
"mudata",
"mulink",
"openpyxl",
"pyarrow",
"scanpy",
"scikit-learn",
# for debug logging (referenced from the issue template)
"session-info2",
"tqdm",
]
optional-dependencies.dev = [
"pre-commit",
"twine>=4.0.2",
]
# TODO: decouple dependencies required for plotting from the core functionality
optional-dependencies.doc = [
# Until pybtex >0.23.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/
"docutils>=0.8,!=0.18.*,!=0.19.*,<0.22", # TODO [AX-1128]: Remove restriction of docutils when https://github.com/executablebooks/sphinx-tabs/issues/212 is fixed
"ipykernel",
"ipython",
"myst-nb>=1.1",
"setuptools",
"sphinx>=4",
"sphinx-autodoc-typehints",
"sphinx-book-theme>=1",
"sphinx-copybutton",
"sphinx-llms-txt",
"sphinx-tabs",
"sphinxcontrib-bibtex>=1",
"sphinxext-opengraph",
]
optional-dependencies.full = [
"alphaquant",
"inmoose",
]
optional-dependencies.full-stable = [
"alphaquant==0.3.1",
"inmoose==0.9.1",
]
optional-dependencies.stable = [
"alphabase==1.8.1",
"anndata==0.12.10",
"bpca==0.1",
"cmcrameri==1.9",
"matplotlib==3.10.8",
"mudata==0.3.8",
"mulink==0.0.1",
"openpyxl==3.1.5",
"pyarrow==23.0.1",
"scanpy==1.11.5", # scanpy version 1.12 dropped support for python<3.12
"scikit-learn==1.8",
"session-info2==0.4",
"tqdm==4.70",
]
optional-dependencies.test = [
"coverage",
"nbmake",
"pytest",
]
# https://docs.pypi.org/project_metadata/#project-urls
urls.Documentation = "https://alphapepttools.readthedocs.io/"
urls.Homepage = "https://github.com/MannLabs/alphapepttools"
urls.Source = "https://github.com/MannLabs/alphapepttools"
[tool.hatch.version]
path = "src/alphapepttools/__init__.py"
[tool.hatch.envs.default]
installer = "uv"
features = [ "dev" ]
[tool.hatch.envs.docs]
features = [ "doc" ]
scripts.build = "sphinx-build -M html docs docs/_build {args}"
scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
scripts.clean = "git clean -fdX -- {args:docs}"
[tool.hatch.envs.hatch-test]
features = [ "test" ]
[tool.hatch.metadata]
allow-direct-references = true # TODO remove once alphabase with anndata is released
[tool.ruff]
line-length = 120
src = [ "src" ]
extend-include = [ "*.ipynb" ]
format.docstring-code-format = true
lint.select = [
"ALL",
]
### STOP: Before adding rules to ignore here, consider disabling them on a per-file or per-line basis!
lint.ignore = [
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs
"ANN204", # Missing return type annotation for special method `__init__`
"ARG001", # TODO: remove soon
"ARG002", # TODO: remove soon
"B008", # Errors from function calls in argument defaults. These are fine when the result is immutable.
"B023", # Function definition does not bind loop variable
"B028", # No explicit `stacklevel` keyword argument found (for warnings)
"COM812", #may cause conflicts when used with the formatter
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # __magic__ methods are often self-explanatory, allow missing docstrings
"D107", # Missing docstring in __init__
# Disable one in each pair of mutually incompatible rules
"D203", # We don’t want a blank line before a class docstring
"D211", # no-blank-line-before-class
"D213", # <> We want docstrings to start immediately after the opening triple quote
"D400", # first line should end with a period [Bug: doesn’t work with single-line docstrings]
"D401", # First line should be in imperative mood; try rephrasing
"E501", # line too long -> we accept long comment lines; formatter gets rid of long code lines
"E731", # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E741", # allow I, O, l as variable names -> I is the identity matrix
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Logging statement uses f-string
"ERA001", # Found commented-out code
"FA102", # Missing `from __future__ import annotations
"FIX002", # things around TO-DO
"G004",
"INP001", # implicit namespace package.
"ISC001", #may cause conflicts when used with the formatter
"LOG015", # call on root logger # TODO remove soon
"N806", # Variable X in uppercase is commonplace in AnnData and should be allowed
"NPY002", # Replace legacy `np.random.normal` # TODO: remove soon
"PD901", # Avoid using the generic variable name `df` for DataFrames
"PLR0913", # Plotting functions for a backend may have many arguments, prioritize sensible defaults
"S301", # Allow pickled data in modules
"T201", # use of 'print' detected # TODO remove soon
"TC002",
"TC003", # Move standard library import into a type-checking block
"TD002",
"TD003",
"TRY003", # Avoid specifying long messages outside the exception class
]
lint.per-file-ignores."*/__init__.py" = [ "F401" ]
lint.per-file-ignores."docs/*" = [
"I",
"SLF001", # Private member accessed
]
lint.per-file-ignores."tests/*" = [
"ANN",
"ARG001", # TODO: remove soon
"ARG002", # TODO: remove soon
"D",
"PT011", #pytest.raises(ValueError) is too broad
"S101", # use of "assert" detected
"SLF001", # Private member accessed
]
lint.pydocstyle.convention = "numpy"
[tool.pytest.ini_options]
testpaths = [ "tests" ]
xfail_strict = true
addopts = [
"--import-mode=importlib", # allow using test files with same name
]
[tool.coverage.run]
source = [ "alphapepttools" ]
omit = [
"**/test_*.py",
]
[tool.ty.environment]
python-version = "3.11"
# Type-check only the shipped package; tests are exempt from annotation checks
# (mirroring ruff's `tests/* -> ANN` ignore) and stray top-level scripts are not
# part of the distribution.
[tool.ty.src]
include = [ "src" ]
[tool.ty.rules]
# anndata types `.X`/`.layers[...]` as a 12+ member union of every storage backend
# (ndarray | csr_matrix | AwkArray | ZarrArray | CSRDataset | None | ...). The pipeline
# treats these as dense numpy arrays (asserts no-NaN, does `data[idx, :] = ...`, reads
# `.shape`), so subscripting, in-place assignment and attribute access are safe at runtime
# but unprovable statically. The rules below fire (almost) exclusively on this union and on
# untyped/dynamic libraries (cmcrameri's generated colormaps, matplotlib's lazy
# submodules, the optional `alphaquant` import). `invalid-argument-type` is deliberately
# kept active — it carries genuine signal here, and union flows into it are narrowed via
# `alphapepttools._utils.get_matrix`.
not-subscriptable = "ignore"
invalid-assignment = "ignore"
unresolved-attribute = "ignore"
no-matching-overload = "ignore"
unsupported-operator = "ignore"
not-iterable = "ignore"
unresolved-import = "ignore"
possibly-missing-submodule = "ignore"
[tool.cruft]
skip = [
"tests",
"src/**/__init__.py",
"src/**/basic.py",
"docs/api.md",
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb",
]