jellycell.run.env_hash¶
Environment hashing with lockfile detection.
Spec §2.3 says the cache key incorporates an env_hash. v0.1 hashed only
the PEP-723 dependencies list, which silently shared caches between
environments that resolved to different concrete versions.
This module picks the best available signal:
If
uv.lockexists at the project root: hash its bytes. Users who care about reproducibility commit a lockfile and get version-level invalidation.Else if
poetry.lockexists: hash its bytes.Else fall back to hashing sorted PEP-723 dependency specifiers — best effort, matches v0.1 behavior for projects without lockfiles.
The precedence is deliberate: a lockfile is a stronger signal than the dependency list, and the first wins.
Module Contents¶
Functions¶
Compute an environment hash for this notebook under |
API¶
- jellycell.run.env_hash.compute_env_hash(project: jellycell.paths.Project, notebook: jellycell.format.cells.Notebook) str¶
Compute an environment hash for this notebook under
project.Checks lockfiles first; falls back to the PEP-723 dependencies list.