-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Configurable project virtual environment paths (e.g., for Docker) #6669
Comments
Currently |
This is solvable though https://docs.astral.sh/uv/guides/integration/docker/#developing-in-a-container |
Even though there is a solution for this need using docker, I think it is still helpful to have a way to configure the path for creating the .venv in uv. For example, I prefer to keep all my venvs under a folder in the home directory (i.e. |
@yasserfarouk Thanks for sharing. That's also discussed in #1495 |
Unfortunately, this is a workaround not a solution, as it has some drawbacks. Solution with anonymous mount for .venv directory causes a rebuild of virtualenv on first use of command with docker compose, as it fully masks the original one created inside the docker image. It is desirable to use the exact virtualenv that was included in the image to have environment as close to the production one as possible. Solution with |
Correct me if I’m wrong, but |
@gbdlin I don't think this is true
It inherits the content from the image. I tested this case explicitly. |
Interesting, good to know. I'd say a bind mount is what you're looking for then. |
You can check it out this way: make sure all volumes for the container are cleared, build the image with Using |
I feel like it's this simple:
Here I run the container with a bind mount and anonymous volume and run Similarly, you can see
If you don't rebuild the image, it won't reflect |
My bad, you are indeed right. Looks like my understanding of anonymous volumes was wrong. Thank you! |
Is this a dupe of #5229? |
@edmorley sort of. If I put on my pedantic hat, this is about configuring the path of the project's virtual environment and the other one is about allowing |
No description provided.
The text was updated successfully, but these errors were encountered: