Skip to content

Commit 69e4d52

Browse files
ccrepyThe kauldron Authors
authored andcommitted
Make Kauldron modular when installing with pip.
PiperOrigin-RevId: 886101489
1 parent 9d5da5e commit 69e4d52

File tree

2 files changed

+54
-21
lines changed

2 files changed

+54
-21
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ Kauldron is a library for training machine learning models, optimized for
2727
post-mortem debugging on borg, runtime shape checking, and many others...).
2828
[Open an issue](https://github.com/google-research/kauldron/issues)..
2929

30+
## Lightweight installation
31+
32+
If you only need specific sub-modules, you can install them individually
33+
without pulling in the full dependency tree:
34+
35+
```bash
36+
pip install kauldron[konfig] # Config system only
37+
pip install kauldron[kontext] # Tree manipulation / key system only
38+
pip install kauldron[ktyping] # Array type checking only
39+
```
40+
41+
A standard `pip install kauldron` still installs all dependencies.
42+
3043
## Citing Kauldron
3144

3245
If Kauldron was helpful for a publication, please cite this repository:

pyproject.toml

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,47 @@ classifiers = [
1313
]
1414
keywords = []
1515

16-
# pip dependencies of the project
17-
dependencies = [
16+
# By default, install all dependencies (backward compatible).
17+
# For lightweight installs, use e.g. `pip install kauldron[konfig]`
18+
dependencies = []
19+
20+
# This is set automatically by flit using `kauldron.__version__`
21+
dynamic = ["version"]
22+
23+
[project.urls]
24+
homepage = "https://github.com/google-research/kauldron"
25+
repository = "https://github.com/google-research/kauldron"
26+
documentation = "https://kauldron.readthedocs.io"
27+
28+
# Other: `documentation`, `changelog`
29+
30+
[project.optional-dependencies]
31+
# Lightweight sub-module installs
32+
konfig = [
1833
"absl-py",
34+
"etils[edc,enp,epath,epy]",
35+
"immutabledict",
36+
"lark",
37+
"ml_collections",
38+
]
39+
kontext = [
40+
"etils[epy,etree-jax]",
41+
"jax",
42+
"ml_collections",
43+
"typing_extensions",
44+
]
45+
ktyping = [
46+
"etils[edc,enp,epath,epy]",
47+
"immutabledict",
48+
"jax",
49+
"lark",
50+
"numpy",
51+
"typeguard>=4.4.1",
52+
]
53+
# Full install (all dependencies, equivalent to the previous default)
54+
# Installed through `pip install kauldron[all]`
55+
all = [
56+
"kauldron[konfig,kontext,ktyping]",
1957
"altair",
2058
"chex",
2159
"clu",
@@ -24,13 +62,8 @@ dependencies = [
2462
"flax",
2563
"grain ; sys_platform != 'win32'",
2664
"graphviz",
27-
"immutabledict",
28-
"jax",
2965
"jaxtyping",
30-
"lark",
3166
"mediapy",
32-
"ml_collections",
33-
"numpy",
3467
"opencv-python", # speeds up pygrain image loading
3568
"optax",
3669
"orbax-checkpoint",
@@ -42,25 +75,12 @@ dependencies = [
4275
"tensorflow",
4376
"tensorflow_datasets>=4.9.7",
4477
"tqdm",
45-
"typeguard>=4.4.1",
46-
"typing_extensions",
4778
"xmanager",
4879
]
49-
50-
# This is set automatically by flit using `kauldron.__version__`
51-
dynamic = ["version"]
52-
53-
[project.urls]
54-
homepage = "https://github.com/google-research/kauldron"
55-
repository = "https://github.com/google-research/kauldron"
56-
documentation = "https://kauldron.readthedocs.io"
57-
58-
# Other: `documentation`, `changelog`
59-
60-
[project.optional-dependencies]
6180
# Development deps (unittest, linting, formating,...)
6281
# Installed through `pip install .[dev]`
6382
dev = [
83+
"kauldron[all]",
6484
"pytest",
6585
"pytest-xdist",
6686
"hypothesis==6.80.0",

0 commit comments

Comments
 (0)