`poetry cache clear` should be able to clear all information for a single package
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
Thanks for making an awesome product.
In my project, I split my code to several packages, which are published to pypi. The problem is after I upload a new version of a package on pypi, poetry doesn’t know that the package has been updated and throw SolverProblemError
(depends on package X which doesn’t match any versions) if I use the updated package somewhere else.
I think this may be due caching. Clearing poetry cache: poetry cache clear pypi --all
does help me solve the problem. However, it’s so slow as poetry has to repopulate the cache for all other packages.
I think it would be great to have:
- the ability to invalidate/clear cache of specific packages, or
- automatically fetch new version of a package if the requested version is newer than the current one in the cache or when it fails to resolve dependencies.
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Commands | master | Documentation | Poetry - Python ...
The cache clear command removes packages from a cached repository. For example, to clear the whole cache of packages from the pypi repository,...
Read more >'poetry install' command fails; *.whl files are not found
It seems to be related to poetry cache. For me, it works as intended if i go to User\user\AppData\Local\pypoetry and I delete the...
Read more >Pipeline caching - Azure - Microsoft Learn
Pipeline caching can help reduce build time by allowing the outputs or downloaded dependencies from one run to be reused in later runs, ......
Read more >Configure a Poetry environment | PyCharm Documentation
Poetry is a tool that facilitates creating a Python virtual environment based on the project dependencies. You can declare the libraries your project ......
Read more >Dependency management - Synapse - GitHub Pages
Clear caches : poetry cache clear --all pypi . Poetry caches a bunch of information about packages that isn't readily available from PyPI....
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
After digging into the source, it turns out you can delete an entry for a specific version of a package:
However, this will not help you in this case because Poetry is using the cached package info: https://github.com/python-poetry/poetry/blob/master/src/poetry/repositories/pypi_repository.py#L204
So, I think the
cache clear
command needs a way to tell it to purge the package info from the cache instead.May tinker with this a bit and see if I can throw together a PR for this functionality.
I confirm this (Poetry v1.1.14), because i have the same trouble again and again. e.g.:
Poetry didn’t find it
pip
found it:It exists: https://pypi.org/project/pyinventory/0.14.0rc1/ Note: it’s not related to the version scheme: I tested
0.14.0rc1
and0.14.0.rc1
and0.14.0rc2
(This is just a example. I see the same behavior in other constellation, after a new release published to PyPi)rm -Rf ~/.cache/pypoetry/cache/
helps here, sometimes, but often not.poetry run pip install -U <PackageName>
will often install the version i need, but poerty didn’t find it. So i assume it’s there and public on PyPi.Also boring: The error message like
Because <foo> depends on <bar> (>=0.14.0rc1) which doesn't match any versions, version solving failed.
if not very helpfull 😦pipenv
has a little bit better error message, because it lists all found versions.EDIT: Adding
allow-prereleases = true
(see also: https://github.com/python-poetry/poetry/issues/4405 ) doesn’t help here, too.EDIT2: Maybe duplicated by https://github.com/python-poetry/poetry/issues/3543 ?