Skip to content

Releases: manzt/juv

v0.3.0

15 Jan 18:05
e0ce712
Compare
Choose a tag to compare

Release Notes

This release adds support for generating lockfiles from Jupyter notebooks using inline metadata, as defined in PEP 723. It is based on uv's recent support for locking standalone scripts, except instead of writing a separate lockfile, juv embeds (and updates) a lockfile in the Jupyter notebook metadata.

By default, notebooks remain unlocked. To lock a notebook, run juv lock /path/to/notebook.ipynb, which generates and embeds a lockfile in the notebook's metadata under the "uv.lock" key. The lockfile is respected and updated automatically when using juv run, uv add, or uv remove.

Additional commands:

  • juv export: Outputs an alternative lockfile format (requirements.txt
    style) to stdout.
  • uv tree: Displays the dependency tree for a script.

Both commands work with notebooks, whether locked or unlocked.

This release is considered breaking due to the lockfile support, which requires a minimum uv 0.5.18 and modifies execution.

Breaking changes

  • Upgrade minimum uv to v0.5 (#63)
  • Respect lockfile in run (#67)

Enhancements

  • Add --clear flag to lock to clear lockfile metadata (#69)
  • Add export command (#70)
  • Add lock command (#64)
  • Add tree command (#68)
  • Sync lockfile during add command (#65)
  • Sync lockfile during remove command (#66)

Bug fixes

  • Require at least one package for add and remove (#73)
  • Support relative paths in the run command (#72)

Contributors

v0.2.28

06 Dec 02:19
Compare
Choose a tag to compare

Other changes

  • Add remove command (#59)

Contributors

Notes

This release adds juv remove to remove packages from a notebook or script. Dependencies are removed from the PEP-723 inline metadata. The command follows uv's semantics. See the uv docs for more information.

uvx juv init
uvx juv add Untitled.ipynb 'numpy>=1.0.0' 'polars' # adds 'numpy>=1.0.0' 'polars'
uvx juv remove Untitled.ipynb numpy # removes 'numpy>=1.0.0'

v0.2.27

04 Dec 03:01
Compare
Choose a tag to compare

Enhancements

  • Force UTF-8 encoding when reading/writing text (#56)

Bug fixes

  • Use TemporaryDirectoryIgnoreErrors in replacement template (#57)

Contributors

v0.2.26

04 Dec 02:28
Compare
Choose a tag to compare

Enhancements

  • Support windows with juv run (#54)

Contributors

v0.2.25

18 Nov 19:16
Compare
Choose a tag to compare

Enhancements

  • Bubble up uv errors from juv add --pin (#52)
  • Add kernelspec metadata to new notebooks (#53)

v0.2.24

14 Nov 19:34
Compare
Choose a tag to compare

Enhancements

  • Add support for regular Python script in juv add (#51)
  • Add --pin flag for juv add (#51)

Notes

This release adds --pin flag to juv add to have package specifiers resolved to an exact version at the time of the command, and subsequently pinned in the notebook/script.

uvx juv init
uvx juv add Untitled.ipynb 'numpy>=1.0.0' 'polars' # adds 'numpy>=1.0.0' 'polars'
uvx juv add Untitled.ipynb numpy polars --pin      # adds 'numpy==2.1.3' 'polars==1.13.1'

This same behavior can be achieved without juv for regular scripts with a unix pipe:

echo 'numpy\npolars' | uv pip compile --no-deps - | grep '==' | xargs uv add --script foo.py

But alternatively you can use juv add for the same thing:

uv init --script foo.py
uvx juv add foo.py numpy polars --pin

v0.2.23

13 Nov 18:56
Compare
Choose a tag to compare

Enhancements

  • Add juv stamp for time-based dependency resolution pinning (#50)

Notes

uv supports time-based dependency resolution via exclude-newer, allowing packages to be resolved as they existed at a specific moment in time.

This feature greatly enhances the reproducibility of one-off scripts and notebooks without needing a lockfile. However, exclude-newer requires a full RFC 3339 timestamp (e.g., 2020-03-05T00:00:00-05:00), which can be tedious to manage manually.

This release introduces juv stamp, a command that provides a high-level, ergonomic API for pinning and unpinning various relevant timestamps in both standalone Python scripts and Jupyter notebooks:

# Stamp a notebook
juv init foo.ipynb
juv stamp foo.ipynb

# Stamp with a specific time
juv stamp foo.ipynb --time "2020-03-05T00:00:00-05:00"
juv stamp foo.ipynb --date 2022-01-03

# Use Git revisions
juv stamp foo.ipynb --rev e20c99
juv stamp foo.ipynb --latest

# Clear the pinned timestamp
juv stamp foo.ipynb --clear
# For Python scripts
uv init --script foo.py
uv add --script foo.py polars anywidget
uvx juv stamp foo.py

v0.2.22

09 Nov 16:36
Compare
Choose a tag to compare

Enhancements

  • Clear widgets metadata in clear (#49)

v0.2.21

08 Nov 00:41
Compare
Choose a tag to compare

Enhancements

  • Upgrade uv to v0.5.0 (#47)

v0.2.20

05 Nov 20:39
Compare
Choose a tag to compare

Enhancements

  • Add --pager flag for juv cat (#45)

Other changes

  • Refactor environment vars to also accept flags (#46)