-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
{cache-dir}/virtualenvs may be too volatile a storage location for some users #3346
Comments
You know you can change the location, which makes it a different default obsolete?
or to the project / repo location:
|
Yes, but I found that out when it already went wrong :-) But it would really be nice to have a more saner default instead. I think |
I would at least expect people to try to find out where the venv goes when deploying this to a production environment, seeing how it obviously doesn't end up in the project directory by default. I agree however that putting them in the cache directory by default might not be the best solution, as that means that your venv could vanish seemingly random at any time you're working with it. At best it's a nuisance because you have to re-run install, at worst this could be rather devastating for someone with a slow or data-capped internet connection. Personally I would prefer them to always end up in the project directory by default, as that means that deleting the project directory will clean up all data associated with it. If it's at a different location, like |
I learned it the hard way, but agreed.
I think that is also a very good solution, perhaps even better. |
This bug just bit me hard on MacOS. Optimization software like CleanMyMac will clear out This seems like a valid and well-documented design decision, and one that |
It depends on the interpretation of the XDG specification:
Is the data essential? It can be reconstructed (by re-downloading) easily, so it sounds rather cache-like. On the other hand, it's a practical annoyance for this data to disappear and force a redownload. Additionally, if the cache is cleared, the user must manually redownload the data, which means it violates the idea that a user should not be able to tell if the cache is suddenly cleared. TL;DR: storing it in |
Theoretically, anything inside rm -rf ~/.cache/pypoetry/virtualenvs
poetry run python main.py # Does not work without additional user interaction!
poetry install # Manual user interaction.
poetry run python main.py # Now it works. Thus, TL;DR: |
Just noting that I just got bitten by this. I've filed a bug report with cleanmymac about it, but looks like its not a true "bug" from the perspective of how Cache is supposed to use (Hopefully they'll put an excemption in for that directory though. That said, if the cache directory is volatile, is a poor choice (And a virtualenv is not a cache) |
Feature Request
Poetry by default saves its virtualenvs in
{cache-dir}/virtualenvs
which by default is~/.cache/pypoetry/virtualenvs
(Linux) and~/Library/Caches/pypoetry/virtualenvs
(MacOS). However, these folders are generally considered to be safe to be removed: Linux, MacOSXDG also specifies to use the cache directory for non essential files. (i.e. those that are trivially recreated without user interaction.)
I report this because I emptied the cache on a server and this dropped the in the background running webserver using a poetry virtualenv, unbeknownst to me (luckily it was weekend).
So I recommend to set a different default for the virtualenv folder. If you follow XDG specifications that would probably be ~/.local/share/poetry/virtualenvs (FYI: Pipenv already uses
~/.local/share/virtualenvs
), and there is probably an similar folder for MacOS.(Default virtualenvs folder for Windows should probably be fine.)
The text was updated successfully, but these errors were encountered: