uv
uv copied to clipboard
Activate and deactivate venv (take uv to a next level of convenience)
Summary
I think it would be awesome if uv remembered the last venv it created (as an environment variable, or in a dot file, it matters not, because the aim simply that afterward uv venv activate would activate it. A universal simple shortcut. And then uv venv deactivate would deactivate it. That woudl of course predicate activate and deactviate as keywords not venv names! I find that a livable compromise but am happy to hear other ideas.
In fact it goes one better, if it remembers the last venv it deactivated again, reactivation is a doddle.
To my mind this would remove my clunkiness form python venv management.
Example
uv venv activate
uv venv deactivate
have you looked at uv run? It manages the environment completely for you.
See https://github.com/astral-sh/uv/issues/1910 for something very similar, and the technical reasons why uv currently doesn't activate the venv for you.