-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Suggest cache clear after fresh package info from --no-cache resolves installation candidate problems
#10585
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
Conversation
…ndidate problems Related to python-poetry#10584
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnhance the installation chooser’s no-links-found error flow to recommend running Sequence diagram for enhanced error message suggesting cache clear after no-links-foundsequenceDiagram
actor User
participant "Poetry CLI"
participant "Chooser (_no_links_found_error)"
User->>"Poetry CLI": Run install/update with --no-cache
"Poetry CLI"->>"Chooser (_no_links_found_error)": No installation candidates found
"Chooser (_no_links_found_error)"->>User: Show error message with cache clear suggestion ("poetry cache clear --all .")
Class diagram for updated _no_links_found_error method in ChooserclassDiagram
class Chooser {
+_no_links_found_error(package, source_hint)
}
Chooser : +Suggests cache clear command in error message
Chooser : +Notes future targeted cache clear improvement (FIXME)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…-getting-fresh-data
…-getting-fresh-data
|
I just noticed that you propose After some digging I think using |
|
Thanks for listing all the mentions. I was not aware of that. Perhaps, we should pay attention not to break this workaround if it does not hurt too much. I will try to take a look if I can implement a more obvious solution to remove all caches, e.g. just call |
|
@MadLittleMods With #10627 we can now just run |
…-getting-fresh-data
…esh-data' of github.com:MadLittleMods/fork-poetry into madlittlemods/10584-clear-poetry-cache-after-getting-fresh-data
…-getting-fresh-data
|
Thanks for the review and merge @radoering 🐏 |
Suggest cache clear after fresh package info from
--no-cacheresolves installation candidate problems.For example, using
poetry update --no-cache {package.name}will fetch fresh package info and update thepoetry.lockfile as expected. But then if you later runpoetry lockagain, it will use the stale cache data and revert those changes (unexpected). It's necessary to clear the cache to get in a consistent state again.Ideally, this kind of behavior would be automatic and part of
--no-cacheor some sort of new option like--prefer-onlinebut there isn't buy-in from maintainers yet. See #10584Based on another existing message in the help log output for another problem,
poetry/src/poetry/installation/chooser.py
Line 248 in 17db1da
This also matches the wisdom in the docs:
poetry/docs/repositories.md
Lines 580 to 589 in 17db1da
Dev notes
Install and use local version of Poetry based on this PR:
poetry/docs/contributing.md
Lines 238 to 262 in 6ace575
Pull Request Check List
Resolves: #10584
docs/repositories.md#L580-L589Summary by Sourcery
Enhance the installation chooser error message to recommend running
poetry cache clear --all .when stale caches persist after using no-cache options and note a future improvement for targeted cache clearing.Enhancements:
--no-cachecommandspoetry cache clearshould be able to clear all information for a single package #4438 for a future targeted cache-clearing commandSummary by Sourcery
Enhance the error message shown when no installation candidates are found after using
--no-cacheto recommend clearing the Poetry cache, and update tests to verify this new suggestion.Enhancements:
poetry cache clear --all .in the no-links-found error after using--no-cacheto refresh package infopoetry cache clearshould be able to clear all information for a single package #4438 for a future targeted cache-clearing commandTests: