Closed woutervh closed 11 months ago
Why?
because libraries installed in a virtualenv should not write to hardcoded externals dirs like ~/.cache/jedi. XDG-directories are a very good default, but they should still remain default.
and setting XDG_CACHE_HOME to some project-specific dir only creates other issues.
and because I want to avoid monkeypatching :)
But this does not explain when you would use this?
I never use jedi directly but subdependencies in many of my projects are.
The whole idea of virtualenvs is to provide a certain isolation from the rest of the system and the ability to run many versions in parallel. Writing to $HOME runs counter to that.
this does not explain when you would use this?
I'm not understanding your question. I never want a virtualenv-installed python library to write to $HOME.
So when would I use this JEDI_CACHE_DIR? In every project that depends on jedi.
But how do you set this? Do you really set this variable by hand in every venv?
I set env-vars in a .env and pip install autoread-dotenv to automatically process the .env.
see https://autoread-dotenv.readthedocs.io/ ( I wrote this package)
examples:
Sorry, this feels not important enough for me. I'm closing.
jedi is mostly installed in a virtualenv, but uses $XDG's ~/.cache/jedi , which is a good default / fallback.
Many python tools/libs allow the user to set the cache_dir via env-var: BLACK_CACHE_DIR MYPY_CACHE_DIR RUFF_CACHE_DIR ....
please support an env-var JEDI_CACHE_DIR