-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
213 lines (187 loc) · 5.84 KB
/
Copy pathpyproject.toml
File metadata and controls
213 lines (187 loc) · 5.84 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "muc_one_up"
version = "0.44.4"
description = "MucOneUp: a tool to simulate MUC1 VNTR diploid references"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
authors = [
{name = "Bernt Popp", email = "bernt.popp.md@gmail.com"},
]
keywords = ["bioinformatics", "genomics", "MUC1", "VNTR", "simulation"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"click>=8.1.0,<9.0",
"orfipy>=0.0.3,<1.0",
"jsonschema>=3.2.0,<5.0",
"rfc8785>=0.1.2", # RFC 8785 JSON Canonicalization Scheme for config fingerprinting
"biopython>=1.80", # Required for FASTA I/O in read simulation and CLI
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0", # Required for mocker fixture in tests
"ruff==0.14.1", # Pinned version - keep in sync with .pre-commit-config.yaml
"mypy>=1.8.0",
"types-jsonschema>=4.0.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
"mkdocs-click>=0.8.0",
"pymdown-extensions>=10.7",
]
docs = [
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
"mkdocs-click>=0.8.0",
"pymdown-extensions>=10.7",
]
[project.scripts]
muconeup = "muc_one_up.cli.click_main:main"
[project.urls]
Homepage = "https://github.com/berntpopp/MucOneUp"
Repository = "https://github.com/berntpopp/MucOneUp"
Issues = "https://github.com/berntpopp/MucOneUp/issues"
Documentation = "https://berntpopp.github.io/MucOneUp/"
# ==================== RUFF ====================
[tool.ruff]
target-version = "py310"
line-length = 100
indent-width = 4
# Exclude build artifacts and caches
exclude = [
".git",
".mypy_cache",
".pytest_cache",
".ruff_cache",
"__pycache__",
"build",
"dist",
"*.egg-info",
]
[tool.ruff.lint]
# Select comprehensive rule set
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
"N", # pep8-naming
"C4", # flake8-comprehensions
"PTH", # flake8-use-pathlib
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # Line too long (handled by formatter)
"B008", # Do not perform function calls in argument defaults
"N802", # Function name should be lowercase (bioinformatics conventions)
"SIM115", # Use context manager for opening files (legacy code style)
"SIM113", # Use enumerate for index variables (not always clearer)
"PTH123", # Use Path.open() instead of open() (backwards compatibility)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "ARG", "PLR2004"] # Allow asserts, unused args, magic values
"__init__.py" = ["F401"] # Allow unused imports in __init__
"helpers/*" = ["N817"] # Allow common acronyms like ET for ElementTree
"scripts/*" = ["RUF001"] # Allow multiplication sign × in documentation strings
[tool.ruff.lint.isort]
known-first-party = ["muc_one_up"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# ==================== MYPY ====================
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
strict_equality = true
check_untyped_defs = true
# Start with gradual typing - can be made stricter over time
disallow_untyped_defs = false
disallow_incomplete_defs = false
no_implicit_optional = true
[[tool.mypy.overrides]]
module = "orfipy.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "orfipy_core.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "jsonschema.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "muc_one_up.bioinformatics.validation"
warn_unreachable = false # False positive with regex pattern matching
[[tool.mypy.overrides]]
module = "rfc8785"
ignore_missing_imports = true
# ==================== PYTEST ====================
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
"--cov=muc_one_up",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
markers = [
"unit: marks tests as unit tests (fast, isolated)",
"integration: marks tests as integration tests (slower, multiple components)",
"slow: marks tests as slow-running (> 1 second)",
"cli: marks tests as CLI interface tests",
"bioinformatics: marks tests as bioinformatics-specific (sequence validation, etc.)",
"requires_tools: marks tests that require specific external tools to be available",
"e2e: marks end-to-end tests requiring real bioinformatics tools (not run in CI)",
]
# ==================== COVERAGE ====================
[tool.coverage.run]
source = ["muc_one_up"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/site-packages/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]