-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Pdm deletes existing virtualenv on calling pdm list or similar #1701
Comments
I started looking more into this and after setting |
It will be cleared if the existing |
From what I can tell, the slow response time makes the python interpreter be considered invalid even before it checks if the version matches. Additionally, the existing
|
I experience the same behaviour. Existing .venv folder will be deleted once I run commands like @samrensenhouse Deactivating the cache did the trick on my end, too. |
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
Hard to give an exact example, but I think this should suffice (the same set of dependencies weren't as slow on other colleagues machines and didn't trigger the issue)
takes more than 5 seconds.
2. Call a pdm command like
pdm list
orpdm run
orpdm install
Actual behavior
Expected behavior
Environment Information
I am not sure if this is more appropriate to raise in the find-python project, but it appears when pdm checks if a virtualenv is valid, part of that check inside of findpython is getting the python version. If it takes longer than 5 seconds to do so, it is considered invalid and triggers the deletion.
I guess I would not expect a command like pdm list to potentially delete a folder. Separate from that, I think findpython could be updated to check for the python version by calling python with the -S option (https://docs.python.org/3/using/cmdline.html#cmdoption-S) which drastically speeds up the process on my machine with the same virtualenv to 0.14 seconds.
The text was updated successfully, but these errors were encountered: