POETRY_CACHE_DIR or cache-dir config are not used at all.
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Windows 10
- Poetry version: 1.0.5
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/mdgilene/0da1568f8ac90615e89cd1331115d80a
Issue
Setting the cache-dir
location using either the environment variable POETRY_CACHE_DIR
or with poetry config cache-dir /path/to/new/cache
does not work. Poetry still uses the default location C:\Users\<user>\AppData\Local\pypoetry\Cache
.
This will not work for me as there are size constraints on my user profile directory. Beacuse of this I need to relocate this directory to another drive.
I believe this to be cause by the fact that the environment/config settings are never read when determining the cache location.
poetry/utils/appdirs.py
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
"appname" is the name of application.
Typical user cache directories are:
macOS: ~/Library/Caches/<AppName>
Unix: ~/.cache/<AppName> (XDG default)
Windows: C:\Users\<username>\AppData\Local\<AppName>\Cache
On Windows the only suggestion in the MSDN docs is that local settings go
in the `CSIDL_LOCAL_APPDATA` directory. This is identical to the
non-roaming app data dir (the default returned by `user_data_dir`). Apps
typically put cache data somewhere *under* the given dir here. Some
examples:
...\Mozilla\Firefox\Profiles\<ProfileName>\Cache
...\Acme\SuperApp\Cache\1.0
OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value.
"""
if WINDOWS:
# Get the base path
path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))
# Add our app name and Cache directory to it
path = os.path.join(path, appname, "Cache")
elif sys.platform == "darwin":
# Get the base path
path = expanduser("~/Library/Caches")
# Add our app name to it
path = os.path.join(path, appname)
else:
# Get the base path
path = os.getenv("XDG_CACHE_HOME", expanduser("~/.cache"))
# Add our app name to it
path = os.path.join(path, appname)
return path
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:21 (12 by maintainers)
Top Results From Across the Web
Configuration | Documentation | Poetry - Python dependency ...
Create the virtualenv inside the project's root directory. If not set explicitly, poetry by default will create virtual environment under {cache-dir}/ ...
Read more >How to cache poetry install for GitHub Actions - Stack Overflow
In your YAML file you are using dschep/install-poetry-action@v1.3 to install Poetry, which sets poetry config virtualenvs.create false ...
Read more >v0.5.0 - Manim Community
Scenes rendered with the OpenGL renderer must only use OpenGL-enabled Mobjects. Deprecated classes and functions#. #1124: Deprecated ...
Read more >cache dir | Data Version Control - DVC
cache dir. Set/unset the cachecache directory location intuitively (compared to using dvc config cache ), or shows the current configured value.
Read more >Configuring Packer - HashiCorp Developer
By default Packer will use known folders, which can be changed by using ... These settings all have reasonable defaults, so you generally...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh interesting…
poetry config
to set the values and have them stored in theconfig.toml
suffice? Why do I also need to set environment variables?Resovled by #5672.