Switch to auto-updating spinners wholesale #14238
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.52) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 431 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #14238"
general
weight: 0.35
ichard26
These are easier to work with and are more flexible since they don't have a
spin()method that needs to be called constantly. One such auto-updating spinner,_PipRichSpinner, was already added for the inprocess build dependency installer. This commit extends this concept for the rest of the codebase.Please note the new spinner interface is a bit weird. For one, spinners can be marked as finished multiple times with only the first call taking effect. This is necessary to ensure robust error handling in case the spinner's caller doesn't actively manage the spinner itself (which is optional).
Furthermore, the final status message is printed even if the spinner was never started. This is carried over from the old spinners. The spinners are interesting since they do two jobs: showing a spinner while pip does work and displaying the final status of said work.
Finally, the spinners don't necessarily auto-start. The backend hook caller has some extra code to decide whether to spin the spinner, so providing for manual start control was needed.
The overall changes look like this:
logger.info()which will be hidden automagically. This is clever, but an explicit no-op spinner is IMO cleaner.This migration has the extra benefit of bringing the inprocess build dependency installer's output handling closer to the subprocess installer. I'd never wired a non-interactive spinner for the inprocess installer originally, oops!
---
Towards https://github.com/pypa/pip/issues/9081, and supersedes and closes https://github.com/pypa/pip/pull/14026.