Package reproducibility in Python notebooks using uv isolated environments

by mscolnickon 9/16/24, 5:09 PMwith 14 comments
by twocupsofcoffeeon 9/16/24, 5:46 PM

Stuff like this is so convenient and intuitive that it makes you wonder why we didn't start here in the first place!

One thing I wonder is how many data scientists will use this feature given that it is not enabled by default (which is understandable, would be messy for every notebook to have a venv), and only via command-line arguments.

I guess this is easily remedied by helpful beginner tooltip UX ("This notebook has several dependencies. Would you like to build it in a sandbox?").

by Onawaon 9/16/24, 5:43 PM

Seems like an admirable goal and the utilization of UV is great! I'm wondering if there's any possibility for integrating this sort of package management into a project like Quarto which already has a strong ecosystem of plugins and outputs from their scientific notebooks. Quarto notebooks are also markdown based and can utilize Jupyter as a back end for Notebook rendering?

by WCSTombson 9/16/24, 7:02 PM

Nice!

I haven't tried this yet, but I love that the functionality of Jupytext is also incorporated, so I guess you get to reproduce the whole end product and all dependencies just from a plain-text script that you can track in Git.

by najorkon 9/16/24, 5:47 PM

How've you found `uv` as a package manager? I've generally been a fan of Astral's tools in the Python ecosystem and I'm considering making the switch from `poetry`.