-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathpyproject.toml
More file actions
387 lines (342 loc) · 9.64 KB
/
Copy pathpyproject.toml
File metadata and controls
387 lines (342 loc) · 9.64 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
[build-system]
requires = [
"setuptools >= 35.0.2",
"wheel >= 0.29.0",
"setuptools_scm[toml]==7.0.5",
]
build-backend = "setuptools.build_meta"
[project]
name = "hydra_zen"
dynamic = ["version"]
description = "Configurable, reproducible, and scalable workflows in Python, via Hydra"
readme = "README.md"
requires-python = ">=3.9"
dependencies = ["hydra-core >= 1.2.0",
"omegaconf >= 2.2.3",
"typing-extensions >= 4.1.0, !=4.6.0",
]
license = { text = "MIT" }
keywords = [
"machine learning",
"research",
"configuration",
"scalable",
"reproducible",
"yaml",
"Hydra",
"dataclass",
]
authors = [
{ name = "Ryan Soklaski", email = "rsoklaski@gmail.com" },
{ name = "Justin Goodwin", email = "jgoodwin@ll.mit.edu" },
]
maintainers = [{ name = "Justin Goodwin", email = "jgoodwin@ll.mit.edu" }]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
]
[project.optional-dependencies]
test = ["pytest >= 3.9", "hypothesis >= 6.28.0", "pytest-trio >= 0.8.0"]
pydantic = ["pydantic>=2.0.0"]
beartype = ["beartype>=0.8.0"]
[project.urls]
"Homepage" = "https://mit-ll-responsible-ai.github.io/hydra-zen/"
"Bug Reports" = "https://github.com/mit-ll-responsible-ai/hydra-zen/issues"
"Source" = "https://github.com/mit-ll-responsible-ai/hydra-zen"
[tool.setuptools_scm]
write_to = "src/hydra_zen/_version.py"
version_scheme = "no-guess-dev"
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*", "tests.*"]
[tool.setuptools.package-data]
hydra_zen = ["py.typed"]
[tool.isort]
known_first_party = ["hydra_zen", "tests"]
profile = "black"
combine_as_imports = true
[tool.ruff]
line-length = 88
target-version = "py39"
exclude = [
".git",
"__pycache__",
"docs",
"old",
"build",
"dist",
"tests/annotations",
"tests/test_py310.py",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
]
ignore = [
"E501", # line too long (formatter handles this)
"E701", # multiple statements on one line
"E721", # type comparison
"F403", # star import
"F405", # name may be undefined from star import
"F811", # redefinition of unused name
]
[tool.ruff.lint.isort]
known-first-party = ["hydra_zen", "tests"]
combine-as-imports = true
[tool.ruff.format]
# Use black-compatible formatting
quote-style = "double"
indent-style = "space"
[tool.coverage.run]
branch = true
omit = ["tests/test_docs_typecheck.py"]
[tool.coverage.report]
omit = ["src/hydra_zen/_version.py"]
exclude_lines = [
'pragma: no cover',
'def __repr__',
'raise NotImplementedError',
'class .*\bProtocol(\[.+\])?\):',
'@(abc\.)?abstractmethod',
'@(typing\.)?overload',
'except ImportError:',
'except ModuleNotFoundError:',
'if (typing\.)?TYPE_CHECKING:',
'if sys\.version_info',
]
[tool.pytest.ini_options]
xfail_strict = true
trio_mode = true
[tool.pyright]
include = ["src"]
exclude = [
"**/node_modules",
"**/__pycache__",
"src/hydra_zen/_version.py",
"**/third_party",
"**/.hypothesis",
"**/docs",
"**/.tox",
]
reportUnnecessaryTypeIgnoreComment = true
reportUnnecessaryIsInstance = false
[tool.codespell]
skip = 'docs/build/*'
[dependency-groups]
# Base test dependencies - used by most tox environments
test = [
"pytest>=3.9",
"hypothesis>=6.115.5",
"pytest-xdist",
"pytest-trio>=0.8.0",
"tzdata",
]
# Formatting tools - SINGLE SOURCE OF TRUTH
# These versions MUST stay in sync across all environments
format = [
"ruff==0.14.1",
"autoflake",
]
# Linting/checking tools - SINGLE SOURCE OF TRUTH
lint = [
"ruff==0.14.1",
"codespell",
"pytest", # Needed for project_tooling/test_headers.py
]
# Coverage-specific tools
coverage = [
"coverage[toml]",
"pytest-cov",
"numpy",
"pydantic>=2.0.0",
"beartype",
"cloudpickle",
]
# Third-party ML/scientific libraries
third-party = [
"torch",
"pytorch-lightning",
"numpy",
"jaxlib",
"jax",
"pydantic>=2.0.0",
"beartype",
]
# Development dependencies - everything you need for local dev
dev = [
{include-group = "test"},
{include-group = "format"},
{include-group = "lint"},
"tox",
"tox-uv",
"pre-commit",
]
[tool.tox]
env_list = ["py39", "py310", "py311", "py312", "py313", "py314"]
[tool.tox.gh_actions.python]
"3.9" = "py39"
"3.10" = "py310"
"3.11" = "py311"
"3.12" = "py312"
"3.13" = "py313"
"3.14" = "py314"
[tool.tox.env_run_base]
description = """
Runs test suite parallelized in the specified python enviornment and
against number of available processes (up to 4).
Run `tox -e py39 -- -n 0` to run tests in a python 3.9 with
parallelization disabled.
"""
pass_env = ["*"]
dependency_groups = ["test"]
deps = ["setuptools"]
commands = [
["pytest", "tests/", "{posargs:-n}", "auto", "--maxprocesses=4"],
]
[tool.tox.env."min-deps"]
description = "Runs test suite against minimum supported versions of dependencies."
base_python = ["python3.9"]
deps = [
"hydra-core==1.2.0",
"omegaconf==2.2.3",
"typing-extensions==4.1.0",
"setuptools",
"pytest",
"hypothesis>=6.115.5",
"pytest-xdist",
"pytest-trio",
"tzdata",
"importlib-resources<6.2.0",
]
[tool.tox.env."pre-release"]
description = "Runs test suite against pre-release versions of dependencies."
pip_pre = true
base_python = ["python3.10"]
dependency_groups = ["test"]
deps = [
"setuptools",
"pydantic>=2.0.0",
"beartype",
"cloudpickle",
]
[tool.tox.env.coverage]
description = """
Runs test suite and measures test-coverage. Fails if coverage is
below 100 prcnt. Run `tox -e coverage -- -n 0` to disable parallelization.
"""
set_env = { "NUMBA_DISABLE_JIT" = "1" }
use_develop = true
base_python = ["python3.10"]
dependency_groups = ["test", "coverage"]
deps = ["setuptools"]
commands = [
["pytest", "--cov-report", "term-missing", "--cov-config=pyproject.toml", "--cov-fail-under=100", "--cov=hydra_zen", "tests", "{posargs:-n}", "auto", "--maxprocesses=4"],
]
[tool.tox.env."pyright-scan-docs"]
description = """
Installs pyright and scans hydra-zen docs & docstrings. Note that this can
be slow. Runs in parallel by default. Run
`tox -e pyright-scan-docs -- -n 0` to disable parallelization.
"""
use_develop = true
base_python = ["python3.10"]
dependency_groups = ["test"]
deps = [
"setuptools",
"torch",
"pytorch-lightning",
"numpy",
"jaxlib",
"jax",
"pydantic",
"beartype",
"scikit-learn",
"matplotlib",
"-r deps/requirements-pyright.txt",
]
commands = [
["pytest", "tests/test_docs_typecheck.py"],
]
[tool.tox.env."third-party"]
description = """
Runs test suite against optional 3rd party packages that hydra-zen
provides specialized support for.
"""
install_command = ["pip", "install", "--upgrade", "--upgrade-strategy", "eager", "{opts}", "{packages}"]
base_python = ["python3.10"]
dependency_groups = ["test", "third-party"]
deps = ["setuptools"]
[tool.tox.env."pydantic-v1-smoketest"]
description = "Ensures that importing pydantic 1.x doesn't break things"
install_command = ["pip", "install", "--upgrade", "--upgrade-strategy", "eager", "{opts}", "{packages}"]
base_python = ["python3.10"]
dependency_groups = ["test"]
deps = [
"setuptools",
"pydantic>=1.10.14,<2.0.0",
]
[tool.tox.env.pyright]
description = """
Ensure that hydra-zen's source code and test suite scan clean
under pyright, and that hydra-zen's public API has a 100 prcnt
type-completeness score.
"""
use_develop = true
base_python = ["python3.10"]
deps = ["-r deps/requirements-pyright.txt"]
commands = [
["pyright", "tests/annotations/", "src/", "--level=error"],
["pyright", "--ignoreexternal", "--verifytypes", "hydra_zen"],
]
[tool.tox.env.format]
description = """
Applies ruff linting and formatting to source files and test suite.
Running this can help fix a failing `enforce-format` run.
"""
skip_install = true
dependency_groups = ["format"]
commands = [
["autoflake", "--recursive", "--in-place", "--remove-duplicate-keys", "--remove-unused-variables", "src/", "tests/"],
["ruff", "check", "--fix", "src/", "tests/"],
["ruff", "format", "src/", "tests/"],
]
[tool.tox.env."enforce-format"]
description = """
Ensures that source materials code and docs and test suite adhere to
formatting and code-quality standards.
"""
skip_install = true
base_python = ["python3.10"]
dependency_groups = ["lint"]
commands = [
["ruff", "check", "src/", "tests/"],
["ruff", "format", "--check", "src/", "tests/"],
["codespell", "src/", "docs/"],
["pytest", "project_tooling/test_headers.py"],
]
[tool.tox.env.docs]
description = """
Uses Sphinx to generate html for the jatic-toolbox's docs. Stores the
results in `.tox/docs/build/html/`.
"""
base_python = ["python3.12"]
change_dir = "docs"
deps = ["-r {tox_root}/docs/requirements.txt"]
commands = [
["sphinx-build", "-b", "html", "-d", "{env_tmp_dir}/doctrees", "./source", "{env_dir}/build/html"],
]