-
-
Notifications
You must be signed in to change notification settings - Fork 186
Expand file tree
/
Copy pathpyproject.toml
More file actions
183 lines (167 loc) · 7.05 KB
/
Copy pathpyproject.toml
File metadata and controls
183 lines (167 loc) · 7.05 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
[project]
name = "CNVkit"
description = "Copy number variation toolkit for high-throughput sequencing."
readme = "README.rst"
#license = "Apache-2.0"
license = {"text" = "Apache-2.0"}
authors = [
{name = "Eric Talevich", email = "me+code@etal.mozmail.com"}
]
maintainers = [
{name = "Eric Talevich", email = "me+code@etal.mozmail.com"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Intended Audience :: Healthcare Industry",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Visualization"
]
requires-python = ">=3.11"
dynamic = ["version", "dependencies", "optional-dependencies"]
[project.urls]
homepage = "https://github.com/etal/cnvkit"
documentation = "https://cnvkit.readthedocs.io"
repository = "https://github.com/etal/cnvkit"
changelog = "https://github.com/etal/cnvkit/releases"
[project.scripts]
"cnvkit.py" = "cnvlib.cnvkit:main"
"cnv_annotate.py" = "cnvlib.cli.cnv_annotate:main"
"cnv_expression_correlate.py" = "cnvlib.cli.cnv_expression_correlate:main"
"cnv_gene_info.py" = "cnvlib.cli.cnv_gene_info:main"
"cnv_updater.py" = "cnvlib.cli.cnv_updater:main"
"genome_instability_index.py" = "cnvlib.cli.genome_instability_index:main"
"guess_baits.py" = "cnvlib.cli.guess_baits:main"
"reference2targets.py" = "cnvlib.cli.reference2targets:main"
"skg_convert.py" = "skgenome.cli.skg_convert:main"
# XXX TODO -- figure out whether this script should and could be included
# in the installation
#"snpfilter.sh" = "scripts/snpfilter.sh"
[build-system]
# Minimum requirements for the build system to execute (PEP 508)
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["cnvlib", "cnvlib.cli", "cnvlib.segmentation", "skgenome", "skgenome.cli", "skgenome.tabio"]
[tool.setuptools.dynamic]
version = {attr = "cnvlib._version.__version__"}
dependencies = {file = "requirements/core.txt"}
optional-dependencies = {test = {file = "requirements/tests.txt"}}
[tool.pytest.ini_options]
testpaths = ["test"]
markers = [
"slow: tests that take >5 seconds (skip with -m 'not slow')",
"hypothesis: property-based tests using Hypothesis (skip with -m 'not hypothesis')",
]
filterwarnings = [
"error",
# bioframe <=0.8.0 uses df.groupby(['col']).groups with a single-element
# list, which pandas 3.0 deprecates via Pandas4Warning.
"ignore:In a future version, the keys of:Warning",
# Hypothesis internal warnings that would otherwise be promoted to errors
"ignore::hypothesis.errors.NonInteractiveExampleWarning",
]
[tool.coverage.run]
branch = true
source = ["cnvlib", "skgenome"]
[tool.coverage.paths]
source = ["cnvlib", "skgenome"]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes (incl. F401 unused-import, F841 unused-variable)
"UP", # pyupgrade
"B", # flake8-bugbear
"NPY", # numpy rules
"PD", # pandas-vet
"RUF", # ruff's extra rules (incl. RUF100 unused-noqa)
"TC", # flake8-type-checking
"PERF", # perflint (numpy/loop performance)
"C4", # flake8-comprehensions
"PIE", # flake8-pie (misc. quality)
"I", # isort (import ordering)
"Q", # flake8-quotes (defensive: format.quote-style enforces double)
"PLC0415", # pylint: imports outside top level (lazy imports must justify with noqa)
# Evaluated and deferred -- noqa cost outweighs the signal here, the
# 3-reviewer code-review protocol catches the real cases better:
# "SIM" -- flake8-simplify; SIM401/SIM115 produce false positives on
# domain types (GenomicArray has no .get(); ctx-via-with is
# invisible to it) and SIM108 compresses readable per-branch
# comments into inline annotations.
# "PT" -- flake8-pytest-style; requires unittest.TestCase -> pytest migration
# "N" -- pep8-naming; collides with scientific names (X, Y, log2, chi2)
# "D" -- pydocstyle; needs a docs-style policy decision
# "ERA" -- commented-out code; needs per-occurrence judgment in this codebase
# "RET" -- return-statement style; RET504 (assign-then-return) is stylistic
# "ARG" -- unused-args; mix of real bugs and intentional API contracts (ABC methods, plugin hooks)
# "ANN" -- flake8-annotations; defer until full annotation coverage decided
]
ignore = [
"E402", # import not at top -- some lazy imports remain legitimate
"E501", # line too long -- too noisy without a reflow pass
"E731", # inline lambda -- common in argparse setups
"UP031", # % format -- kept; modernization is a separate focused PR
"B007", # loop variable not used in body -- common idiom in this code
"B023", # def closing over loop variable -- intentional in some places
"PD009", # use .iloc instead of .iat -- iat is faster for scalar access
]
[tool.ruff.lint.per-file-ignores]
# Test suites use `from cnvlib import (access, antitarget, ...)` smoke-test
# blocks (see CLAUDE.md "Imports in Tests"). The imports are intentionally
# "unused" -- they verify each submodule loads cleanly. F401 must not fire
# on these blocks but should still catch real unused imports in cnvlib/.
"test/*" = ["F401"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
# numpy >= 2.5 ships PEP 695 ``type`` aliases in its stubs, which mypy only
# parses with a 3.12+ target; the type-check CI job runs on 3.12. (The runtime
# baseline stays 3.11, enforced by ruff target-version and the py311 test job.)
python_version = "3.12"
packages = ["cnvlib", "skgenome"]
ignore_missing_imports = true
check_untyped_defs = true
warn_no_return = true
warn_return_any = true
warn_unused_configs = true
warn_unreachable = true
enable_error_code = ["ignore-without-code"]
[tool.bandit]
# Skip security rules inappropriate for bioinformatics toolkit that needs to call external tools
skips = [
"B101", # assert_used - asserts are an intentional idiom here, incl. type narrowing
"B404", # subprocess module - needed for calling bioinformatics tools like samtools, R
"B603", # subprocess without shell=True - this is actually good security practice
"B607", # partial executable path - standard practice for bioinformatics pipelines
]