I finally have a procedure in place I like for hacking on Python CLI apps using a development environment managed by uv - full notes here:
https://til.simonwillison.net/python/uv-cli-apps
I finally have a procedure in place I like for hacking on Python CLI apps using a development environment managed by uv - full notes here: 5 comments
@simon Cool post! I am not sure the `tool.uv.dev-dependencies` is the same as, or interoperable with, PEP 735 though. @simon Extra tip: you can do uv tool install -e ., and now you can run demo-app directly, without the uv run prefix, in any directory. @simon Then, for scripts you run frequently, do you just add to your.bashrc `alias demo=“uv run python -m demo_app”`? My few python CLI apps each have a .venv directly, but it’s tiresome to have to juggle activations: `source ~/bin/demo/.env/activate && demo && deactivate’. 🫠 @com once I'm done developing the tool I'll install it permanently, probably using the version I ship to PyPI (so I guess I'll use "uv tool install name-of-package") |
@simon having just started experimenting with uv, this is *exactly* what I’ve been looking for - thanks!