Re:uv Running a Script with Dependencies
by CraigJPerry on Tuesday July 22, 2025 @02:15AM
(#44643717)
Yeah i don't think there is a neater way to do this right now. One thing that maybe saves some effort is a "uv sync" will pay attention to the $VIRTUAL_ENV env var, but only if that var points to a venv that already exists. You can't point to an empty dir and have it create the venv.
but it's still janky, not sure it saves much mental tax
[ Parent
| on HN ]
I'd encourage using --dry-run before running uv sync, by default it can be destructive.
By default, an exact sync is performed: uv removes packages that are not declared as dependencies of the project. Use the `--inexact` flag to keep extraneous packages.