-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Create virtual env hash based on lock file instead of parent directory #2927
Comments
@matzhaugen I do not think this is feasible; since this would mean that everytinme the lock changes, poetry re-creates a venv. While that is okay and even preferred in a CI environment, not so much for development environments. You should consider using |
Thanks for the quick response. Yes that is a good point. It probably isn't feasible for development environments, but maybe if it were an optional argument? With However, there still wouldn't be a trivial way to share it without some other project being able to import it, even if you had the venv copied to some global directory. So I recognize that maybe this is not the right way to go about it. |
Unfortunately, same issue. Also, I would not recommend sharing virtualenvironments unless the systems are identical in the first place. In cases like CI environments, typically you cache the venv based on poetry/.github/workflows/main.yml Lines 45 to 59 in dfa5c0f
I am not sure if this is a large enough use case that cannot be solved elswhere. If it is, we could look at enabling some sort of option for this, |
The code you give above is actually a nice way to solve this in a CI setting. I'll just do that. More generally, I agree that changing the |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
When building the same poetry package with the same lock file on a different machine, e.g. On different VMs in a jenkins PR build cluster, the virtual environment will hash to something different if the VM is not the same. This is because the folder parent directory is different, e.g.
/home/PR123/pyproject.toml
vs//home/PR124/pyproject.toml
.I think it would be nice to have the virtual env hash be the same in these to instances if and only if the lock file is identical.
The text was updated successfully, but these errors were encountered: