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

Virtual environments folder outside project #8830

Closed
tmct opened this issue Nov 5, 2024 · 3 comments
Closed

Virtual environments folder outside project #8830

tmct opened this issue Nov 5, 2024 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@tmct
Copy link

tmct commented Nov 5, 2024

Hi,

I was hoping you could help solve my problem please.

At work I am often developing in a situation where I have a persistent storage directory (let's say at /persist/code) as well as ephemeral user directories (say at /home/me). I want to develop in /persist/code (including uv projects!), but I cannot hardlink in that folder, which drastically slows down uv pip installs etc.

For other workflows (e.g. using hatch) I can work around this by defaulting to ephemeral virtual environments in a path in /home/me, which my projects reference. But uv appears to strongly push for virtualenv living alongside code (in .venv). I can understand why that choice is usually very nice, especially when you don't have to activate environments, but is there a way to tell uv "I would like you to create all my virtual environments in this folder somewhere else, by default" please? (It looks like I could set UV_PROJECT_ENVIRONMENT, but unless I wanted environments to overwrite each other, I would need to vary that setting per project/workspace.)

I am wondering what the best way to achieve this might be - what might you suggest?

Thanks,
Tom

@zanieb
Copy link
Member

zanieb commented Nov 5, 2024

Duplicate of #1495

@zanieb zanieb marked this as a duplicate of #1495 Nov 5, 2024
@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
@zanieb zanieb added the duplicate This issue or pull request already exists label Nov 5, 2024
@zanieb
Copy link
Member

zanieb commented Nov 5, 2024

I'd recommend setting UV_PROJECT_ENVIRONMENT with direnv or something for now. We haven't designed a solution to this yet.

@tmct
Copy link
Author

tmct commented Nov 5, 2024

Thank you! That will do nicely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants