by BiteCode_dev · 2y ago · 0 comments
The problem with that is that eventually too many scripts means you will hit incompatibilities in Python where you can only install one version of a lib in each venv.
This trick is perfect because:
- From now on, I always install uv on all my machines anyway.
- After the first run, not only the cache make it fast, but it uses hard links so that you don't even pay the of multiple install on disk space (that's also how they are so fast in creating the envs, that and some interesting HTTP/zip tricks: https://www.bitecode.dev/p/charlie-marsh-on-astral-uv-and-th...).
- Deps are clearly defined in the script, so it's self-documenting.
For prod, shiv (https://shiv.readthedocs.io/) is probably your best bet but I'm betting uv will come up with a version of that soon.
Do you have any good sources for learning shiv? The docs are very sparse & lack examples and there aren't as many blogs discussing shiv as I'd hoped.
Also, do you know if shiv works on Windows?
But yes, unlike pex, shiv works on windows.
It's very different than pyinstaller in the sense that:
- it uses a standard (the zipapp format from python stdlib)
- it assumes python is already installed (it's not stand alone)
I definitely should write on article on that on Bite Code on day. Adding it to the list.