Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
236 lines (205 loc) · 6.68 KB
/
Copy pathpyproject.toml
File metadata and controls
236 lines (205 loc) · 6.68 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
[project]
name = "esm"
version = "3.5.0"
description = "EvolutionaryScale open model repository"
readme = "README.md"
requires-python = ">=3.12"
license = {file = "LICENSE.md"}
authors = [
{name = "EvolutionaryScale Team"}
]
maintainers = [
{name = "Zeming Lin", email = "zeming+esm@evolutionaryscale.ai" }
]
classifiers = [
"Development Status :: 3 - Alpha",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"torch>=2.11.0",
"transformers>=5.16.0",
"ipython",
"einops",
# biotite 2 renamed RigidTransformation fields and annotate_sse output, breaking from_rcsb.
"biotite>=1.0.0,<2",
"rdkit",
"msgpack-numpy",
"biopython",
"scikit-learn",
"brotli",
"attrs",
"pandas",
"cloudpathlib",
"httpx",
"tenacity",
"zstd",
"ipywidgets",
"py3dmol",
"pydssp",
"boto3",
# Both are imported directly by esm.models.hub, esm.models.esmc and
# esm.models.esmfold2; they resolved only because transformers happens to pull
# them in.
"huggingface_hub",
"safetensors",
"pygtrie",
"dna_features_viewer",
"accelerate",
# CPU-index torch doesn't pull triton in, but the ESMFold2 kernels import it.
"triton>=3.6; sys_platform == 'linux' and platform_machine == 'x86_64'",
]
# Pytest
[tool.pytest.ini_options]
addopts = """
--cov=esm
--cov-report term-missing:skip-covered
-n auto
-m 'not gpu and not manual'
--ignore=tests/oss_pytests/test_oss_client.py
"""
markers = [
"gpu: requires a CUDA device",
"manual: run by hand, never by CI",
"merge_only: needs a real published checkpoint (network or staged weights)",
]
[tool.setuptools]
package-dir = {"" = "."}
include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["esm*"]
[tool.setuptools.package-data]
esm = ["data/*"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
# These are build dependencies, to ensure pip support, keep run-time deps above in `dependencies`
[tool.pixi.target.linux-64.activation.env]
LD_PRELOAD = "$CONDA_PREFIX/lib/libstdc++.so.6${LD_PRELOAD:+:$LD_PRELOAD}"
[tool.pixi.dependencies]
python-dateutil = "<3"
matplotlib-base = "*"
filelock = "*"
pandas = "*"
colorama = "*"
setuptools = "<82"
scipy = "*"
pyyaml = "*"
pkg-config = "*"
cmake = "*"
pip = "*"
twine = "*"
# Python is per-feature rather than a workspace dependency so one manifest can
# solve every version CI exercises.
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[tool.pixi.feature.py314.dependencies]
python = "3.14.*"
[tool.pixi.pypi-dependencies]
esm = { path = ".", editable = true }
[tool.pixi.tasks]
build-wheel = "python -m pip wheel --no-deps -w dist ."
upload-wheel = "python -m twine upload --repository pypi"
[tool.pixi.feature.dev.dependencies]
matplotlib = "*"
numpy = ">=2.0.0,<2.4"
pre-commit = "*"
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
pytest-xdist = "*"
seaborn = "*"
ty = "==0.0.49"
[tool.pixi.feature.dev.pypi-dependencies]
# DockQ is optional at runtime. Keep the NumPy 2-compatible fork in the dev
# environment for tests without publishing its direct URL in package metadata.
dockq = { git = "https://github.com/nrontsis/DockQ.git", rev = "ba4df5adaad7c77fd60851d0b7b05f2b77061ba2" }
[tool.pixi.feature.dev.tasks]
lint-all = "pre-commit run --all-files --show-diff-on-failure"
cov-test = "pytest -v --junitxml=pytest.xml --cov=esm"
# PyPI rejects URL requirements, so pip users get this command from a warning in
# esm/models/esmc/kernels.py instead. The wheel is cp312-only.
# The wheel only loads on torch 2.11 but its metadata says plain `torch`, so pin
# torch here. Bump the pin and the wheel URL together.
[tool.pixi.feature.py312.target.linux-64.pypi-dependencies]
torch = "==2.11.*"
flash_attn = { url = "https://github.com/evolutionaryscale/wheels/releases/download/py312-pt211-cu13-sm80-90/flash_attn-2.7.4.post1-cp312-cp312-linux_x86_64.whl" }
# opt_core: the "fast" / "big" kernels (sm_90a cubins, loaded at run time).
[tool.pixi.target.linux-64.pypi-dependencies]
opt-core = { url = "https://github.com/evolutionaryscale/wheels/releases/download/opt-core/v0.5.228.0/opt_core-0.5.228.0-py3-none-any.whl" }
cuda-bindings = ">=13.3,<14"
[tool.pixi.environments]
default = {features = ["py312"], solve-group = "default"}
dev = {features = ["dev", "py312"], solve-group = "default"}
dev-py313 = {features = ["dev", "py313"], solve-group = "py313"}
dev-py314 = {features = ["dev", "py314"], solve-group = "py314"}
[tool.ruff]
extend-include = ["*.ipynb"]
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`), sort imports ('I')
select = ["E4", "E7", "E9", "F", "I"]
ignore = [
# allow variable == False (tensors should do this)
"E712",
# allow assigning of lambdas
"E731",
# Allow ambiguous variables, e.g. we use O for oxygen
"E741",
# Ignore errors from jaxtyping hints
# https://docs.kidger.site/jaxtyping/faq/#flake8-or-ruff-are-throwing-an-error
"F722",
# TODO: Fix the few offenders in a follow up PR
"E721",
]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
known-third-party = ["wandb"]
[tool.ruff.format]
skip-magic-trailing-comma = true
docstring-code-format = true
docstring-code-line-length = "dynamic"
[tool.isort]
known_third_party = ["wandb"]
[tool.ty.src]
# gitignore-style globs. Skip notebooks, tests, and the Modal-app tutorial whose deps
# (modal, abnumber) and dynamic decorators aren't resolvable in the lint env.
exclude = [
"**/*.ipynb",
"**/*_test.py",
"**/test_*.py",
"**/tests/",
"**/conftest.py",
"cookbook/tutorials/binder_design.py",
]
[tool.ty.rules]
# Strict LSP override-compatibility checking that pyright `basic` never enforced; low
# value for duck-typed ML code.
invalid-method-override = "ignore"
# flash_attn resolves only where it's installed (a GPU environment); the ignores it
# requires there read as unused/redundant in this CPU lint env where it's absent.
unused-ignore-comment = "ignore"
unused-type-ignore-comment = "ignore"
[tool.ty.analysis]
# ty can't introspect optional/compiled deps absent from this lint env (flash_attn is
# GPU-only; zstd is a C-extension), so it falsely reports them unresolved. Treat as Any
# rather than disabling unresolved-import, so genuinely-broken first-party imports still
# surface.
replace-imports-with-any = [
"biotite.database",
"biotite.database.**",
"biotite.structure",
"biotite.structure.**",
"biotite.sequence.align",
"biotite.sequence.align.**",
"scipy.spatial",
"flash_attn",
"flash_attn.**",
"zstd",
]
[tool.importlinter]
root_package = "esm"