Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the creation of non-activatable envrionments #10083

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nathanscain
Copy link

@nathanscain nathanscain commented Dec 21, 2024

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 calling get_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 scripts
  • uv venv --not-activatable does not create an environment with activation scripts
  • uv run when there isn't an existing environment, creates one with activation scripts
  • uv run when there is an existing environment without activation scripts, leaves the environment without activation scripts
  • when the default behavior is to not have activation scripts, uv venv --activatable creates a virtual environment with activation scripts
  • selecting the environment in vscode appears unaffected by the missing scripts

TODO

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to not create the activate* scripts in venvs
1 participant