-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
269 lines (255 loc) · 10.3 KB
/
Copy pathpyproject.toml
File metadata and controls
269 lines (255 loc) · 10.3 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
261
262
263
264
265
266
267
268
269
####################################################################################################
############################### BUILD CONFIGURATION ##############################################
####################################################################################################
[build-system]
requires = ["cmake>=3.27", "nanobind==2.10.2", "setuptools>=77"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
include-package-data = true
package-dir = { "" = "." }
# version is supplied by setup.py so the CUDA local segment (e.g. 0.4.0+cu131)
# lands in the wheel METADATA — see setup.py. It stays in [project].dynamic below.
[tool.setuptools.packages.find]
where = ["."]
include = ["bionemo_ir*"]
# Every shipped Python package has an __init__.py. Regular package discovery
# prunes unrelated checkout directories before descending into them; implicit
# namespace discovery walks the entire workspace, including ignored build trees.
namespaces = false
[tool.setuptools.package-data]
"bionemo_ir" = [
"_torch/custom_ops/*/configs/*.json",
"_torch/attention_backend/*/configs/*.json",
]
[project]
name = "bionemo-ir"
description = "BioNeMo Inference Runtime: GPU accelerated framework for protein folding"
requires-python = ">=3.12,<4.0"
authors = [{ name = "NVIDIA-BioNeMo team" }]
dependencies = [
"cuda-python>=13",
"torch>=2.11",
"cuequivariance==0.11.1",
"cuequivariance-ops-cu13==0.11.1",
"cuequivariance-ops-torch-cu13==0.11.1",
"triton>=3.6.0,<3.7.1",
"biopython>=1.87",
"ray[serve,data]==2.56.1", # Installs pandas and pyarrow.
# uvloop 0.22 breaks Ray Serve: https://github.com/ray-project/ray/issues/57992
"uvloop==0.21.0",
"modelcif==1.6", # Needed for CIFWriter.
"rdkit==2025.9.6", # Needed for the Boltz2 data pipeline.
"nvidia-cutlass-dsl[cu13]==4.5.2",
"nvidia-cudnn-frontend==1.23.0",
"apache-tvm-ffi>=0.1.6,<0.2",
"biotite==1.6.0",
# https://github.com/huggingface/datasets/issues/7344
"datasets==4.8.4",
# hf_hub_download(), currently transitive through datasets.
"huggingface_hub>=0.25,<2",
"PyYAML>=6.0.3",
"lru-dict==1.4.1",
"kalign-python==3.6.0",
"scipy==1.13.1",
"gemmi==0.6.5",
"einops>=0.8", # rearrange() and einsum() are imported directly.
"pydantic>=2,<3",
]
# readme is dynamic because setup.py rewrites it for a package index: an index
# renders it standalone, resolving no relative path and stripping no frontmatter.
dynamic = ["version", "readme"]
license = "Apache-2.0"
license-files = ["LICENSE", "THIRD_PARTY_NOTICES.md", "LICENSES/*.txt"]
# Rendered as the sidebar links on the PyPI project page, which is built from
# this metadata alone -- a published version's page cannot be edited afterwards.
[project.urls]
Homepage = "https://github.com/NVIDIA-BioNeMo/BioNeMo-Inference-Runtime"
Documentation = "https://docs.nvidia.com/bionemo/inference-runtime"
Repository = "https://github.com/NVIDIA-BioNeMo/BioNeMo-Inference-Runtime"
Issues = "https://github.com/NVIDIA-BioNeMo/BioNeMo-Inference-Runtime/issues"
[dependency-groups]
build = [
# PEP 517 build environments are independent of project dependencies. Keep
# the native build reproducible without narrowing the package's compatible
# build-system floors below.
"cmake==4.4.2",
"nanobind==2.10.2",
"setuptools==81.0.0",
]
coverage = [
"coverage[toml]>=7.10.6",
]
lint = [
"prek==0.4.12", # Pinned for reproducible hook runs.
]
release = [
{ include-group = "build" },
# Tools used after the build stay here rather than in the default developer
# environment. Release CI syncs this complete group from uv.lock.
"auditwheel==6.8.0",
"build==1.5.0",
# Match the digest-pinned NGC base: DALI 2.1.0 requires packaging<=26.0.
"packaging==26.0",
"pip==26.2.1",
"wheel==0.47.0",
]
sbom = [
# Isolated CI tool for inventorying the packages actually installed in NGC.
"cyclonedx-bom==7.4.0",
]
test = [
"pytest>=9.0.3", # Older releases contain PYSEC-2026-1845.
"pytest-cov>=7.1.0",
"pytest-xdist>=3.8.0",
# tests/contract runs setup.py.
"setuptools>=77",
"parameterized",
"biotraj==1.2.2",
"ml_collections==1.1.0",
]
dev = [
{ include-group = "lint" },
{ include-group = "test" },
]
[tool.uv]
required-version = ">=0.12.9,<0.13"
default-groups = ["dev"]
# CUTLASS's base and CUDA 13 wheels contain overlapping paths. Install in
# dependency order so the CUDA 13 wheel consistently supplies those files.
concurrent-installs = 1
# Keep uv's isolated editable builds on the same internal toolchain as the
# locked build group without narrowing the published PEP 517 compatibility
# floors in build-system.requires.
build-constraint-dependencies = [
"cmake==4.4.2",
"nanobind==2.10.2",
"setuptools==81.0.0",
]
# BioIR only supports Linux. Keep both release architectures in every lock
# update so an x86_64 developer cannot silently break aarch64 resolution.
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'",
"sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'",
]
required-environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'",
"sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'",
]
# uv otherwise notices only Python packaging metadata. These inputs and
# environment variables also determine the editable native extension.
cache-keys = [
{ file = "pyproject.toml" },
{ file = "setup.py" },
{ file = "build.env" },
{ file = "cpp/**/CMakeLists.txt" },
{ file = "cpp/cmake/**/*.cmake" },
{ file = "cpp/cmake/**/*.py" },
{ file = "cpp/kernels/**/*.cpp" },
{ file = "cpp/kernels/**/*.h" },
{ file = "cpp/kernels/cutedsl_*/cubins/index.json" },
{ file = "cpp/kernels/cutedsl_*/cubins/packs/*.tar.xz" },
{ env = "BIOIR_BUILD_CUTEDSL_KERNELS" },
{ env = "BIOIR_VERSION_LOCAL" },
{ env = "CUDA_TAG" },
{ env = "CC" },
{ env = "CXX" },
]
####################################################################################################
############################### LINTING, FORMATTING AND TESTING CONFIGURATION ####################
####################################################################################################
[tool.ruff]
line-length = 120
target-version = "py312"
# 3rdparty is vendored and never linted.
extend-exclude = ["3rdparty"]
[tool.ruff.lint]
# Enforced on changed files only, so the set stays low-noise: rules with little
# existing debt and mostly auto-fixable, to avoid bloating small MRs.
select = [
# pycodestyle errors — PEP 8 violations (indentation, syntax-y style).
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"E",
# Pyflakes — real bugs: unused imports/vars, undefined names, f-string issues.
# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F",
# pycodestyle warnings — whitespace, blank lines, deprecated constructs.
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"W",
# isort — import ordering and grouping (auto-fixed).
# https://docs.astral.sh/ruff/rules/#isort-i
"I",
# pyupgrade — modernize syntax for the target Python (e.g. `list` over `List`).
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP",
# flake8-bugbear — likely bugs and footguns (mutable defaults, `raise` from).
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# flake8-debugger — leftover `breakpoint()` / `pdb` calls.
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T10",
# flake8-comprehensions — simpler, faster list/dict/set comprehensions.
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C4",
# flake8-pie — remove redundant/dead constructs (dup dict keys, no-op code).
# https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PIE",
# flynt — prefer f-strings over `str.join` / `%` / `.format`.
# https://docs.astral.sh/ruff/rules/#flynt-fly
"FLY",
# pygrep-hooks — ban blanket `# noqa` / `# type: ignore` (enforces the
# "avoid # type: ignore" rule in docs/coding.md).
# https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PGH",
]
# The formatter owns line wrapping; long strings/URLs/comments shouldn't fail lint.
# E741: single-letter names like B/I/J/H/D and l are the domain's tensor
# shape-dim convention here; renaming would obscure the math and ripple across
# call sites for no readability gain.
# E731: assigning a lambda to a name is used deliberately for small local
# helpers; rewriting to def is low-value churn.
# UP042: rewriting `class X(str, Enum)` to `enum.StrEnum` is a behaviour change,
# not a style fix. New enums should still subclass `enum.StrEnum`.
# https://docs.astral.sh/ruff/rules/replace-str-enum/
ignore = ["E501", "E741", "E731", "UP042"]
[tool.ruff.lint.isort]
known-first-party = ["bionemo_ir"]
# Branch coverage over the shipped package. The test job runs two pytest phases
# (see scripts/run_tests.sh) and phase 1 fans out over xdist workers,
# so the data has to merge across processes and across runs.
[tool.coverage.run]
branch = true
# One data file per process (xdist worker, phase), combined before reporting.
parallel = true
# Store paths relative to the measurement root, so data files produced by
# different processes merge cleanly.
# https://coverage.readthedocs.io/en/latest/config.html#run-relative-files
relative_files = true
# The repo root, NOT ["bionemo_ir"]: coverage strips the configured source
# root from the Cobertura filenames, and CI only maps coverage onto the review
# diff when those filenames are repo-relative (bionemo_ir/foo.py). What
# actually gets measured is narrowed to the package by `--cov=bionemo_ir`
# in scripts/run_tests.sh; the omits below keep a bare
# `pytest --cov` honest too.
source = ["."]
omit = [
# Vendored third-party trees (mirrors ruff's extend-exclude and prek.toml).
"*/3rdparty/*",
# The suite measures the shipped package, not itself.
"tests/*",
# Packaging script, not shipped package code.
"setup.py",
]
[tool.coverage.report]
show_missing = true
precision = 2
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@(abc\\.)?abstractmethod",
"if __name__ == .__main__.:",
]
[tool.commitizen]
# Conventional Commits. Used now only to lint commit/MR titles (`cz check`).
# Changelog generation (`cz changelog`) and version bumps (`cz bump`) are a
# follow-up — that's why the version config below is intentionally minimal.
name = "cz_conventional_commits"