forked from mahfouzlab/ViralScan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
177 lines (162 loc) · 5.42 KB
/
Copy pathpyproject.toml
File metadata and controls
177 lines (162 loc) · 5.42 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ViralScan"
dynamic = ["version"]
description = "A computational framework to detect viral load."
authors = [
{name="Emma Vonk", email="emma.vonk@hotmail.nl"}
]
license = {file = "LICENSE"}
dependencies = [
"snakemake>=7.0.0",
"pyfiglet",
"scanpy",
"pandas",
"plotly",
"numpy",
"matplotlib",
"scipy",
"seaborn",
"pyyaml",
"requests>=2.28",
"jinja2>=3.0",
"scikit-learn>=1.0",
"anndata>=0.9",
]
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
[project.optional-dependencies]
dev = [
"pytest>=7",
"pytest-cov",
"responses",
"ruff",
"mypy",
"pre-commit",
]
enrichment = [
"gget>=0.27",
]
[project.scripts]
viralscan = "viralscan.menu:main"
[tool.setuptools.dynamic]
version = {attr = "viralscan.__version__"}
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
"viralscan" = ["Snakefile", "templates/*.j2"]
"viralscan.data" = ["anellovirus_accessions.tsv"]
"viralscan.scripts" = ["emptydrops.R"]
[project.urls]
"Homepage" = "https://github.com/mdmanurung/ViralScan"
"Bug Tracker" = "https://github.com/mdmanurung/ViralScan/issues"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra -m 'not network and not integration and not research'"
markers = [
"network: tests that hit the live NCBI API",
"integration: end-to-end Snakemake smoke tests",
"research: tests of repo-root analysis scripts (scripts/*), not the installed package",
]
[tool.ruff]
line-length = 100
target-version = "py39"
# Lint the shipped package + its tests only. Repo-root research/analysis/build
# scripts and data dirs are out of scope for the package's lint gate.
extend-exclude = [
"analysis",
"covid_viralscan",
"scripts",
"benchmark_runs",
"benchmark_inputs",
"results",
"references",
"docs",
]
[tool.ruff.lint]
# Hardened ruleset (RR4.4): pycodestyle errors + pyflakes + isort (I),
# flake8-bugbear (B), pyupgrade (UP), flake8-simplify (SIM).
select = ["E4", "E7", "E9", "F", "I", "B", "UP", "SIM"]
ignore = [
"E501", # line length is enforced by the formatter
"UP007", # `X | None` PEP-604 style — cosmetic; `Optional[...]` kept for py39 clarity
"UP045", # same, for Optional
"SIM117", # nested `with` (readable for stacked patch() in tests)
]
[tool.ruff.lint.per-file-ignores]
# Snakemake script files receive an implicit ``snakemake`` global injected
# by the Snakemake runner; they are not standalone Python modules. They
# also contain a few historical issues that PR 3 will clean up.
"src/viralscan/scripts/analysis.py" = ["F821", "F401"]
"src/viralscan/scripts/createconfig.py" = ["F821"]
"src/viralscan/scripts/detection.py" = ["F821", "F401", "F541", "SIM102"]
"src/viralscan/scripts/multimap.py" = ["F821", "F541"]
"src/viralscan/scripts/umap.py" = ["F821", "F401", "F541", "SIM102"]
"src/viralscan/scripts/host_filter.py" = ["SIM115"]
"src/viralscan/scripts/hostresponse.py" = ["F821"]
[tool.mypy]
python_version = "3.10"
warn_unused_configs = true
# Third-party scientific libs ship no/partial stubs; don't fail on missing imports.
ignore_missing_imports = true
# The scverse/accelerator stack (anndata, scanpy, numba, zarr, …) ships `py.typed`
# and uses PEP 695 (`class Foo[T]`) syntax that mypy rejects while type-checking
# against python_version=3.10 (e.g. anndata>=0.13). Their bodies are not ours to
# check, so skip-follow them — treat as Any without parsing. This keeps the lint
# job robust across upstream releases instead of pinning mypy's target to 3.12
# (which would forfeit 3.10-syntax gating on our own code) or pinning the deps.
[[tool.mypy.overrides]]
module = [
"anndata.*",
"scanpy.*",
]
follow_imports = "skip"
[[tool.mypy.overrides]]
module = [
"viralscan.utils",
"viralscan.constants",
"viralscan.menu",
"viralscan.scripts.ncbi_fetch",
"viralscan.scripts.build_reference",
]
strict = true
# RR4.3: the 7 Snakemake scripts are type-checked (in non-strict mode) rather than
# blanket-ignored. They import the injected `snakemake` global (untyped), so
# attr-defined/name-defined on that object is tolerated.
[[tool.mypy.overrides]]
module = [
"viralscan.scripts.analysis",
"viralscan.scripts.createconfig",
"viralscan.scripts.detection",
"viralscan.scripts.multimap",
"viralscan.scripts.umap",
"viralscan.scripts.host_filter",
"viralscan.scripts.hostresponse",
"viralscan.scripts.cellcalling",
# research/benchmark tooling, not core pipeline — same relaxed treatment
"viralscan.reference_strategy",
]
# Type-checked for real errors (arg-type, return-value, assignment, union-attr, …)
# instead of blanket-ignored. Tolerate the injected untyped `snakemake` global and
# annotation-completeness gaps (full annotation is a separate task).
disable_error_code = [
"name-defined",
"attr-defined",
"no-untyped-def",
"no-untyped-call",
"type-arg",
]