-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpyproject.toml
More file actions
261 lines (231 loc) · 8.75 KB
/
Copy pathpyproject.toml
File metadata and controls
261 lines (231 loc) · 8.75 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "proto-language"
version = "0.1.0"
description = "A high level programming language for generative biology"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Proto Team"},
{name = "Ben Viggiano"},
{name = "Daniel Guo"},
{name = "Lucas Brennan-Almaraz"},
{name = "Brian Hie"},
{name = "Aditi Merchant"},
]
maintainers = [
{name = "Proto Team"},
{name = "Ben Viggiano"},
{name = "Daniel Guo"},
{name = "Lucas Brennan-Almaraz"},
{name = "Brian Hie"},
{name = "Aditi Merchant"},
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]
# Core dependencies
dependencies = [
"proto_tools @ git+https://github.com/evo-design/proto-tools.git@main",
# Core framework
"pydantic>=2.0",
# Scientific computing
"numpy>=1.20",
"pandas>=1.5",
"scipy>=1.10",
"scikit-learn>=1.3.0",
# Bioinformatics
"biopython>=1.81",
"biotite>=0.38.0,<1.2.0",
"rdkit!=2026.3.3", # 2026.3.3's bundled rdchem.pyi stub is malformed and breaks mypy; drop when fixed upstream
# Notebooks & visualization
"jupyter",
"ipykernel",
"ipywidgets",
"ipymol",
"py3Dmol",
"matplotlib",
# Utilities
"tqdm",
"openpyxl",
"docstring-parser", # Extract per-field docs from Google-style config docstrings
]
[project.urls]
Homepage = "https://github.com/evo-design/proto-language"
Repository = "https://github.com/evo-design/proto-language"
[project.scripts]
# CLI entry point; also reachable via `python -m proto_language`.
proto-language = "proto_language.cli:main"
[project.optional-dependencies]
# Development and testing tools
dev = [
"pytest>=7.3.0", # --strict-markers requires 7.3+
"pytest-asyncio>=0.21", # asyncio_mode="auto" requires 0.21+
"pytest-cov>=4.1.0",
"pytest-forked", # Required on Sherlock (exclusive GPU process mode)
"pytest-randomly>=3.15",
"ruff==0.15.12",
"mypy==1.20.2",
"types-tqdm", # mypy stubs for tqdm (used by bar-aware logging)
]
[tool.setuptools.packages.find]
include = ["proto_language*"]
exclude = ["tests*", "examples*", "*.tests*", "*.tests", "proto-tools*"]
[tool.setuptools.package-data]
proto_language = ["py.typed"]
[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = ["proto-tools", "*.egg", ".*", "build", "dist"]
pythonpath = ["."]
addopts = [
"-ra",
"-v",
"--tb=short",
"--strict-markers",
"--strict-config",
"--import-mode=importlib",
"--durations=20",
]
markers = [
"asyncio: mark test as requiring asyncio",
"uses_cpu: mark test as CPU-only. Optional arg: @pytest.mark.uses_cpu(n) skips unless n CPUs are visible (matches the count proto_tools' _detect_cpus would see)",
"uses_gpu: mark test as requiring GPU. Optional arg: @pytest.mark.uses_gpu(n) skips unless n GPUs are visible",
"slow: Slow tests that may take several minutes",
"integration: Integration tests (require external tools like MAFFT). Skipped by default.",
"skip_ci: Skip test in GitHub Actions CI",
"extensive: Combinatorial tests (e.g., every constraint × optimizer). Skipped unless --ext (or --extensive) is passed",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s | %(levelname)-8s | %(name)s | %(message)s"
[tool.mypy]
python_version = "3.10"
plugins = ["pydantic.mypy"]
strict = true
warn_unreachable = true
enable_error_code = ["redundant-expr", "truthy-bool", "ignore-without-code", "deprecated"]
explicit_package_bases = true
[[tool.mypy.overrides]]
module = [
# Scientific / ML (only modules actually imported from proto_language/)
"biotite.*",
"rdkit.*",
"promoter_calculator.*",
# Data / cloud (stubs exist but not installed — add pandas-stubs, types-openpyxl to adopt)
"pandas.*",
"openpyxl.*",
# Visualization / other
"pymol.*",
"vortex.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["proto_tools.*"]
follow_imports = "skip"
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.ruff]
target-version = "py310"
line-length = 120
exclude = [
".venvs",
"*/.venvs",
"__pycache__",
".git",
"build",
"dist",
"*.egg-info",
"proto-tools",
"examples",
"guides",
]
[tool.ruff.lint]
select = [
# ── Tier 1: Essential ─────────────────────────────────────────────
"F", # Pyflakes — unused imports/vars, undefined names
"E", # pycodestyle errors — comparison bugs, syntax
"W", # pycodestyle warnings — whitespace
"I", # isort — import ordering (fully auto-fixable)
"UP", # pyupgrade — modernize syntax (almost fully auto-fixable)
"B", # flake8-bugbear — mutable defaults, exception chaining
"S", # flake8-bandit — security (hardcoded creds, SQL injection, eval)
"T20", # flake8-print — debug print() left behind
"ERA", # eradicate — commented-out code
"D", # pydocstyle — Google convention docstring quality
# ── Tier 2: Strongly recommended ──────────────────────────────────
"SIM", # flake8-simplify — collapse nested ifs, use builtins
"C4", # flake8-comprehensions — unnecessary list()/dict() wrappers
"RET", # flake8-return — clean up return patterns
"PIE", # flake8-pie — unnecessary pass, duplicate class fields
"RUF", # Ruff-specific — mutable defaults, missing f-prefix
"PERF", # Perflint — performance anti-patterns
"FURB", # refurb — modern Python idioms (fully auto-fixable)
"PLE", # Pylint errors — real bugs
"PLW", # Pylint warnings — subprocess without check
"ARG", # flake8-unused-arguments — unused function arguments
"TID", # flake8-tidy-imports — ban relative imports
"ASYNC", # flake8-async — async anti-patterns
"A", # flake8-builtins — catch shadowing of Python builtins
]
ignore = [
"E501", # line too long — let `ruff format` handle this
"PLW1641", # eq-without-hash — Pydantic models handle __hash__; non-Pydantic uses are intentional
"D105", # missing magic method docstring — __repr__, __eq__ are self-documenting
"RUF022", # unsorted-__all__ — keep logical grouping with section comments
"A002", # argument-shadowing-builtin — `format` param is intentional for export functions
]
[tool.ruff.lint.per-file-ignores]
"proto_language/cli.py" = ["T201"] # CLI entry point: print() is the right way to emit to stdout
"proto_language/__main__.py" = ["T201"] # python -m proto_language entry point
"scripts/run_guide_notebooks.py" = ["T201", "S603"] # dev runner: print() to stdout; subprocess args are controlled, not user input
"tests/**/*.py" = [
"S101", # assert is the whole point of tests
"S105", # hardcoded password strings ok in test fixtures
"S106", # hardcoded passwords ok in test fixtures
"S110", # try-except-pass ok in test cleanup
"S112", # try-except-continue ok in test loops
"ERA001", # commented-out test code sometimes intentional
"B017", # assert-raises-exception — test patterns, refactor later
"SIM117", # multiple-with-statements — readability preference in tests
"D100", "D101", "D102", "D103", "D104", "D106", "D107", # docstring presence rules relaxed in tests
"ARG", # pytest fixtures appear as unused arguments
]
[tool.ruff.lint.isort]
known-first-party = ["proto_language"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.format]
docstring-code-format = true
[tool.coverage.run]
branch = true
source = ["proto_language"]
omit = [
"*/tests/*",
# Git submodule (source already filters; defensive)
"proto-tools/*",
# Constraint plugins: tool-bound, only @pytest.mark.integration tests
"proto_language/constraint/*/*",
# Logging stdlib wrapper: handler plumbing
"proto_language/utils/logging_config.py",
]
[tool.coverage.report]
fail_under = 80
show_missing = true
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "raise NotImplementedError"]