-
Notifications
You must be signed in to change notification settings - Fork 959
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 for uv
global instantiation
#7898
Comments
Related
It seems like this is doable today with some small wrappers around uv, I'm not sure we'll add first-class support for this. |
The solution above works perfectly and seems to be a straightforward replacement for pyenv. Here’s a bit more detail about my setup:
Additionally, I added the following function to my function uvactivate() {
source ~/.config/uv/venv/.uv$1/bin/activate
} With this setup, I can activate my environment/s from anywhere by simply calling Then any Would be nice to have the |
On our end, we simply do |
@CharlesPerrotMinotHCHB: with your proposed way, under
Instead, for anything you do, you will always dip into |
@krstp true, but we're running in docker container. And to me, it makes sense for a global instantiation to be overwritten |
Yeah, for the docker it makes sense. What I am and was aiming for with global setup/instantiation is local env development. If it is only in docker, I agree it does not make sense, but in local imho it does shine and what I propose is an easy fix. |
For the reference to the issue, here seems to be a related tool that somewhat accomplishes similar functionality: https://github.com/AndydeCleyre/zpy |
I think we can track this in #1495. |
Just for reference, where this really shines is when using code editors for specifying a default release. Currently, user needs to do its own mumbo-jumbo (as specified above) to have such environment. AFAIK most of editors do not allow for in-project venv read. |
I don't think this is true, e.g., VSCodes does discover virtual environments in the project directory. What are you referring to here? |
I would like to see
uv
recognized for global virtual environments in a similar way to howpyenv
works. Instead of focusing solely on in-project folder development, allow for global env instantiation.In theory, this task should be accomplished by creating all virtual environments via:
uv venv ~/.venvs/my_project_env
To activate the environment:
source ~/.venvs/my_project_env/bin/activate
Alternatively,
uv
could add the following function to.bashrc/.zshrc
:Then users could activate an environment like this:
uvactivate my_project_env
The text was updated successfully, but these errors were encountered: