Validate built wheel project identity - #223
Closed
zaniebot wants to merge 1 commit into
Closed
Conversation
zaniebot
force-pushed
the
zb/bughunt200/164-validate-built-wheel-identity
branch
from
July 15, 2026 18:17
9ef09f3 to
bd8fb7e
Compare
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.
Warning: truncated output (original token count: 5372)
Total output lines: 287
A project declaring
configured-name==1.0can emit an internally consistentdifferent_name-9.0-py3-none-any.whland report success because the direct-wheel build plan supplies no expected identity. Validate normalized static identity and stage the wheel until validation passes, preventing a rejected artifact from remaining publishable indist/while preserving existing output. RetainUV_SKIP_WHEEL_FILENAME_CHECK=1andversion.without_local()compatibility for malformed/nightly wheels (uv#16046); keep this distinct from filename/METADATA and sdist/wheel consistency.Ordinary
uv python installmatches an existing managed installation only by its key and ignores an explicitUV_PYTHON_*_BUILDpin, so an outdated build is retained. Compare the requested build identity before reuse, completing the reproducible-build pinning requested in uv#14263 and the installed-build marker added in uv#15314. Managed install/download finalization is concurrently changing in uv#20286, uv#19840, and uv#20309.A newline in
uv venv --promptcan inject a secondpyvenv.cfgkey such asinclude-system-site-packages = true, silently changing environment isolation. Reject CR/LF before creating the environment so failure leaves no partial.venv. Keep newline containment independent from the overlapping prompt-evaluation work in uv#19812.Centralized environment keys use lexical workspace paths, so reaching one project through a directory symlink creates a second environment and reinstalls its dependencies. Canonicalize workspace identity before selecting the centralized environment, preserving the single-environment expectation from the centralized-environment design in uv#14628 and uv#18214.
pyvenv.cfgkeys are matched case-sensitively even though CPython lowercases them, so a case-variantInclude-System-Site-Packagescan be ignored and leak system dependencies. Normalize configuration keys without changing values.Concrete equality requests such as
uv python find --managed-python '==3.14t'lose the free-threaded/debug/GIL variant during specifier lowering and can select the wrong interpreter. Reapply the requested variant after equality parsing. Wildcard and range requests keep their existing semantics; this changes selection only for explicit equality requests that include a variant. uv#16434 tracks related free-threaded requirement compatibility.Environment discovery silently skips a broken child
.venvsymlink and continues walking upward, allowing pip to mutate an unrelated ancestor environment. Treat the explicit broken child boundary as an error and report its exact path, preserving the broken-link diagnostic established in uv#12168. Coordinate the related invalid-.venvfallback work in uv#20333.Host-platform support treats Emscripten as supported everywhere, so an explicit
cpython-3.14-emscriptenrequest can select native CPython unless an architecture is also supplied. Require the requested target operating system to match, complementing the PyEmscripten/PEP 783 platform support introduced in uv#19629.A UTF-8 BOM reaches
PythonRequest::parsefrom.python-version, causing a valid pin to be treated as an unsupported executable name and discovery to select another interpreter. Strip a leading BOM while preserving the file's other parsing semantics.Publish and auth-login settings diagnostics can render raw tokens, passwords, or credential-bearing URLs despite hidden environment values. Redact all secret-bearing fields and nested URLs in
--show-settingsoutput without obscuring non-secret configuration; uv#8840 demonstrates that settings diagnostics can expose a PAT in pipeline logs.Publish renders raw arguments before settings resolution, so
--show-settingsomits the configured publish URL, trusted-publishing policy, check URL, and keyring settings. Render the resolved settings and redact publish tokens and credentials embedded in check or configured-index URLs while retaining useful diagnostics; uv#8840 demonstrates that settings diagnostics can expose a PAT in pipeline logs. This overlaps the proxy-index publish settings work in #20218.Requirements-file
--no-binary/--only-binary a,bis rejected even though pip and uv's CLI accept comma-separated package policies. Parse the package list consistently, including:all:and:none:resets, completing the pip-compatibility work introduced in uv#2680 for uv#1461. Coordinate the active requirements-option rewrite in uv#16489.Repeated
--no-binary/--only-binarydirectives across nested requirements can lose ordering: a child:none:reset may leave the parent's policy active. Replay policy events in source order so reset and last-wins semantics match pip, extending the compatibility work introduced in uv#2680 for uv#1461. Coordinate the active requirements-option rewrite in uv#16489.Valid attached pip forms such as
-rfile,-cfile,-fpath,-iURL, and-epathrequire an unnecessary separator in uv. Accept attached short-option values and resolve local-fpaths against the parser working directory, preserving the existing-r/-cdeclaring-file and-eworking-directory semantics established in uv#1421.Include, index, and find-links values containing a literal
#are truncated as comments when no whitespace precedes the hash. Preserve hashes within option values while retaining normal whitespace-delimited comments.pip permits replacement
--index-urldirectives, including across nested includes, while uv rejects repetition. Apply ordered last-wins handling consistently. This reverses uv's deliberate ambiguity error from uv#1146: an included requirements/constraints file can override an operator-controlled index, a previously identified security concern (uv#6407). Coordinate the active parser rewrite (uv#16489).Unknown prefixes such as
--prefixed-optioncan be interpreted as--pre, while--no-indexedcan become anedrequirement. Require complete option-name matches before dispatch so unsupported flags cannot silently change resolution, preserving the warn-and-ignore behavior introduced in uv#10420. Coordinate the active requirements-option rewrite in uv#16489.PEP 508 marker parsing incorrectly requires whitespace before an opening parenthesis and rejects valid
and(/or(grouped expressions. Accept the grammar form without changing ordinary marker tokenization.python_version in "3.12.1"on Python 3.12 evaluates incorrectly because version/range lowering discards PEP 508 substring-membership semantics. Preserve string membership; this intentionally revisits the algebra/performance tradeoff in uv#6172, which documented the divergence to keep marker operations tractable. Raw substring BDD nodes change universal-lock/fork representation and performance, so keep that compatibility tradeoff explicit.Universal compile drops markers from editable requirements such as
-e ./project ; sys_platform == "linux", making them unconditional on other platforms. Preserve editable environment markers through lowering and simplification. This touches the same editable-requirements lowering path as active uv#19151.An exclusive prerelease bound such as
>1a1can incorrectly reject an installed1.post1even though the post-release is compatible. Correct the greater-than prerelease/post-release comparison while preserving local-version normalization, complementing the earlier exclusive-comparison fix in uv#12836 for uv#12834.Legacy
.egg-infouninstalls need to readentry_points.txtto remove console and GUI launchers, but loading and parsing currently live in the wheel reader. Add anEntryPointsreader that owns missing-file handling and parsing while preserving existing script and versioned pip-launcher behavior from uv#1593. This is a behavior-neutral prerequisite for completing the legacy-uninstall support introduced in uv#3380.Moved to: astral-sh/uv-dev#203.