Repository navigation
Route Python upgrade request errors through UvError - #21568
Merged
zanieb merged 1 commit intoSep 11, 2026
Merged
Conversation
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 9, 2026 19:20
1f48ab2 to
d14cb29
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 9, 2026 19:35
d14cb29 to
c4c613b
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 04:04
c4c613b to
c634794
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 04:09
c634794 to
6dc25f6
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 04:42
6dc25f6 to
ef229c5
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 04:47
ef229c5 to
fc94d09
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 13:05
fc94d09 to
db72fd6
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 13:22
db72fd6 to
9f217a0
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 13:36
9f217a0 to
a2ecf06
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 15:07
a2ecf06 to
a097227
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 20:11
a097227 to
1624ea5
Compare
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 21:51
1624ea5 to
db48d61
Compare
zanieb
had a problem deploying
to
automations
September 10, 2026 21:52 — with
GitHub Actions
Failure
zanieb
marked this pull request as ready for review
September 10, 2026 21:53
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 10, 2026 22:18
db48d61 to
83e64dd
Compare
zanieb
had a problem deploying
to
automations
September 10, 2026 22:19 — with
GitHub Actions
Failure
zanieb
force-pushed
the
zb/python-upgrade-error-hints
branch
from
September 11, 2026 18:12
83e64dd to
132eefa
Compare
UvError
zanieb
added a commit
that referenced
this pull request
Sep 11, 2026
Route the remaining package-operation errors through `UvError` and the standard error-chain renderer, then remove uv's direct `miette` dependency and global hook. Diagnostics use the same source-chain formatting and hint collection as other commands, with cause-specific hints before general command advice. No-solution headings omit trailing punctuation, retain their command context, and are not repeated inside build-dependency errors. Final errors remain visible with `-q` and are suppressed with `-qq`. Classify operation failures by their underlying cause instead of by which renderer handles them. Each error type owns its classification, and type-erased build errors forward it. Expected package, resolution, build, integrity, and lock-validation failures use code 1, while recognized transport, cache, filesystem, and internal failures use code 2. This deliberately changes some previously inconsistent statuses without attempting to normalize every standalone command or opaque archive-error path. Command-line argument errors remain code 2. Third-party dependencies may still use `miette` internally. Prior work: - #14546 removed `miette` from `uv venv`. - #17535 added first-party line wrapping. - #18090 established the `Hint` and `Hints` APIs. - #20155 made hints explicit in error-chain rendering. - #20156 preserved indentation in multiline causes. - #20159 migrated `uv build` errors to standard rendering. - #20160 migrated tool requirement errors to standard rendering. - #20188 introduced the explicit `UvError` model. - #20163 routed final errors through `Printer` for `-q` and `-qq`. - #20217 enabled cause-chain rendering for user errors. - #21563 added verification of index-provided metadata hashes. - #21279 reused URL-provided hashes during resolution. - #21584 renamed the hint-producing trait to `Hinted`. - #21577 added explicit hint ordering. Follow-up work: - #21566 collects hints for batched `uv tool upgrade` failures and fixes their quiet-mode output. - #21568 routes Python upgrade request errors and version-file hints through `UvError`. - #21587 separates operation-specific diagnostic context from exit-status classification. - #21599 renders error and warning causes with compact tree connectors.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python upgrade rejects patch and prerelease requests by printing directly to ordinary stderr, so
-qhides the error and its.python-versionguidance. Represent this as a typed user error and collect the version-file hint throughHinted. The message remains visible with-q, is suppressed with-qq, and keeps exit code 1. Explicit command-line version requests do not receive the version-file hint.Prior work:
UvErrormodel.-qand-qq#20163 defines the final-error behavior for-qand-qq.