Allow the creation of non-activatable envrionments #10083
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
To resolve #10070 by allow environments to be created without activation scripts in them.
Saves a bit of time when only uv will be used to interact with the environment meant. This is off by default for user-facing environments (
uv venv
and anything callingget_or_init_environment
) and on by default for internal environments so no time is wasted in environments that would never be directly interacted with (tool installs, isolated calls to uv run, package builds with build isolation, etc). Saves a bit of time writing files for everyone in those isolated envrionments, while letting those who want it to go more aggressive.Test Plan
All current tests pass. Will probably need to work with you on how you'd like this tested.
Locally, I have verified that:
uv venv
creates an environment with activation scriptsuv venv --not-activatable
does not create an environment with activation scriptsuv run
when there isn't an existing environment, creates one with activation scriptsuv run
when there is an existing environment without activation scripts, leaves the environment without activation scriptsuv venv --activatable
creates a virtual environment with activation scriptsTODO
Still need to make this configurable as a
uv.toml
/pyproject.toml
option, but the core behavior is working so I figured I'd throw in draft to make sure I'm on the right path.