-
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
POETRY_CACHE_DIR or cache-dir config are not used at all. #2445
Comments
Far from ideal, but as a workaround you can temporarily set/replace XDG_CACHE_HOME=/path/to/another/drive/cache poetry add black (tested on 1.0.9) |
Hello, I tested it with the latest preview release without any problems. Is someone else able to reproduce the issue? fin swimmer |
I've found something strange behavior on this topic. When testing with normal user account,
|
I can confirm this is still happening in Linux. Even after setting POETRY_CACHE_DIR, I see Poetry Version: 1.1.4 |
Perhaps it makes more sense to just drop the "cache-dir" config option, rather than trying to plumb it through the other places that are directly using Honouring |
I'm sorry but "just remove it" is not a valid solution. It is common practice among many development tools that utilize a local cache to allow the user to configure where this cache is stored. My workplace uses network storage for users home directories so that settings can be used on multiple machines. This however means that we are VERY limited on how much can be stored on the user profile (<500Mb). I HAVE to move this cache to another location or I just simply cannot use the tool. |
changing XDG_CACHE_HOME (also XDG_CONFIG_HOME and XDG_DATA_HOME) breaks other apps when we run those apps under 'poetry shell'. Changing The change In my PR provides alternate to |
I don't think Edit: I see that Anyway, fair 'nuff, if the cache-dir config is useful, then it should only take a few fixes to make it apply, by making sure that nothing directly accesses It might also be good to fix the default for On the last comment, I'm not sure what My use-case is that I'm running But in the general case, the cache-env setting should be either fixed or removed. I personally don't mind which, as I don't have a use-case where I need to move just the Poetry cache. @mdgilene In your circumstance, you probably should be changing You probably do want to change the |
The PR doesn't modify This way, all I have to do in my bootstrap script is set
the point is why someone has to change Also, there is no way to make poetry store its config in a different place other than changing In my openion, |
Maybe this is a difference of opinion on Your use of But I think in the general case, mutating "creates hidden directories under Anyway, that PR, and discussion about the use-cases of Adding another conditional default doesn't fix this issue, it just adds another possible workaround. |
Is there any workaround for this on windows? Perhaps some environment variable like I'm running multiple instances of Poetry at one once and I'm getting a conflict in the cache directory.
So I want to use a different cache directory for each invocation. Although, this is probably a separate issue that needs to be addressed. |
- This is the documented way to provide a cache location to poetry,though it does not actually speed up the build significantly. - See python-poetry/poetry#2445 for further information about caching in poetry.
* Initial functionality - No offline functionality as Poetry does not current support vendoring - Caching may work but is untested * Add .github directory. * Fix lint in test. * Add caching to poetry install process. - This is the documented way to provide a cache location to poetry,though it does not actually speed up the build significantly. - See python-poetry/poetry#2445 for further information about caching in poetry. * Remove specific version of poetry buildpack from integration test. - this was required while there was not a published version of the poetry buildpack. We can drop this now that the poetry buildpack has been released. * Remove unused Pip constant. - this buildpack does not use pip directly so it can be removed. * Remove unneccessary requirements.txt from integration test fixture. * Update README.md * Update README.md Co-authored-by: Tim Hitchener <thitch97@users.noreply.github.com> Co-authored-by: Tim Hitchener <thitch97@users.noreply.github.com>
Can confirm this happens in version 1.1.13 in a docker container:
Firing up the container with user 1000 and running
It fails because ofc user 1000 does not have access to |
@abn has this been acknowledged? Can we configure the repository cache? |
Resovled by #5672. |
This is happening for me on PS> poetry config --list
cache-dir = "C:\\Users\\username\\.poetry\\Cache"
experimental.new-installer = true
experimental.system-git-client = false
installer.max-workers = null
installer.no-binary = null
installer.parallel = true
virtualenvs.create = false
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "C:\\Users\\username\\.poetry\\venv"
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}" When adding to my packages, PS> poetry add --group dev instaviz
Using version ^0.6.0 for instaviz
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 2 installs, 33 updates, 0 removals
• Updating frozenlist (1.3.0 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/9e/6f/48/9c41b19462554c732ac11adcb6c12e9b911989c263486d33dd8ad69d41/frozenlist-1.3.0-cp38-cp38-win_amd64.whl -> 1.3.0)
• Updating idna (3.3 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/f7/09/c9/8e80952436ff87855ddff4891a35ecf913b2b5dc97911f02a070ff2b1f/idna-3.3-py3-none-any.whl -> 3.3)
• Updating multidict (6.0.2 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/2b/3f/f0/c9166f505465acaba68c94bdb3f4001777bb73290a85cddc10d17fb6a9/multidict-6.0.2-cp38-cp38-win_amd64.whl -> 6.0.2)
• Updating pyparsing (3.0.9 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/4a/b9/34/28557b740fb51bd635f6794a95d02e23de02724e07f03c3ad49cebcf86/pyparsing-3.0.9-py3-none-any.whl -> 3.0.9)
• Updating aiosignal (1.2.0 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/4c/98/1b/ee90d29611d2aaeb4a2b40c1509ca578cccf552d05a53563f4f8bf9bb3/aiosignal-1.2.0-py3-none-any.whl -> 1.2.0)
• Updating async-timeout (4.0.2 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/31/90/f6/e2df01736b095fcbabf93cf579a4d9b8d7a4a78c4c63fad4d32320b197/async_timeout-4.0.2-py3-none-any.whl -> 4.0.2)
• Updating attrs (21.4.0 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/9a/27/ab/6895b786f345452394b42c1fdbe863803d0396e675b632c01cb13cad92/attrs-21.4.0-py2.py3-none-any.whl -> 21.4.0)
• Updating six (1.16.0 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/48/e6/04/8118155ae3ec3a16dd2a213bbf7a7d8a62c596b2e90f73a22c896269f1/six-1.16.0-py2.py3-none-any.whl -> 1.16.0)
• Updating packaging (21.3 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/7f/d5/4c/1d3c4776012fc0bbe1f86e69bde2c5e36d2d32caa2e4845ac1fc08ab3f/packaging-21.3-py3-none-any.whl -> 21.3)
• Updating charset-normalizer (2.0.12 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/ae/14/8e/087a104edb7ec627884755272de815d8ee4fd53b8745fdb12a087dd2e1/charset_normalizer-2.0.12-py3-none-any.whl -> 2.0.12)
• Updating tomli (2.0.1 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/36/bd/11/98fa2af866c73d00f2498ade62c7fcf28db8656714b7b7a44e9cb2f855/tomli-2.0.1-py3-none-any.whl -> 2.0.1)
• Updating yarl (1.7.2 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/a2/6a/27/e9e84dba14a393ddac771dd9ae65439811ec491d75b056170ce6150ec8/yarl-1.7.2-cp38-cp38-win_amd64.whl -> 1.7.2)
• Updating aiohttp (3.8.1 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/73/ef/d8/f992ece989563634df5070549065fcdac89ed7d2ecdaf35697139624a9/aiohttp-3.8.1-cp38-cp38-win_amd64.whl -> 3.8.1)
• Updating cycler (0.11.0 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/37/9c/25/cbaf98f95cc74b0a7617cef17520e3f063dbabd9f0f8a04f93a15f6632/cycler-0.11.0-py3-none-any.whl -> 0.11.0)
• Updating pillow (9.1.1 C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/56/93/0d/15304aaa1b5631edde44db83af439458145ca775bb4a04a4596b43c17a/Pillow-9.1.1-cp38-cp38-win_amd64.whl -> 9.1.1) |
check "Default Directories" section in this doc https://python-poetry.org/docs/master/configuration/ . It provides details about how you can override the default directories |
@mohan43u Thank you, but I think I have those set already? The above printout of PS> $env:POETRY_CACHE_DIR
C:\Users\username\.poetry\Cache is set as a system environment variable. I even cleared my cache PS> poetry cache clear --all . and regardless Using NOTE: In the above, I've replaced my actual username with " |
@mohan43u @abn After disabling the For example, {"archive_info": {}, "url": "file:///C:/Users/username/AppData/Local/pypoetry/Cache/artifacts/7e/42/12/cd512fbb1274bf257081cb661ba45881d717adc618df1a73d3a5532da8/numpy-1.22.4-cp38-cp38-win_amd64.whl"} I believe if |
@adam-grant-hendry You may need to set three environment variables to alter poetry's default directories instead of single
|
Oh interesting....
|
Is this the right way to set cache and config dir when installing? because the cache and config are still set to |
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. |
-vvv
option).Issue
Setting the
cache-dir
location using either the environment variablePOETRY_CACHE_DIR
or withpoetry config cache-dir /path/to/new/cache
does not work. Poetry still uses the default locationC:\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
The text was updated successfully, but these errors were encountered: