| UV has done so much for Python but I did fight it a bit today. I was trying to centralize the management of a script that appears in a few different repos, and has invariably drifted in its implementation in multiple way over time. My idea was uv run --with $package main --help I was looking for an easy way to automatically 1. Install it if it doesn’t exist and run
2. Don’t install it if it’s running the latest version
3. Update if it’s not on the latest version All three were surprisingly tricky to accomplish. By default uv run will reinstall it every time. Which is 6 seconds of venv and installs uvx or uv tool weren’t much better as that posed new problems where a user wouldn’t get upgrades. I ended up having the script run a paginated GET on codeartifact and update if there’s a newer non-dev version (and then re-execute). That seems to work. And 200ms delay is better than 6 seconds. But it wasn’t quite the experience I wanted. |
Please feel free to open a reproduction with details and we can look into it.
(I work on uv)