fix(uv): Transition build deps of whls back to libs #772
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.

Fix a bug when a requirement with no bdists is depended on as a whl rather than as a
py_librarywhich manifests asbuild not founderrors which are confusing because inlibmode, the requirement will build just fine.In order to facilitate future pex/sci-e/zipapp support, one of the features of the uv machinery is that the requirements graph can be configured so that dependencies occur either as installed library trees OR as pre-install wheel files. This solves a persistent issue with zipapp-like things of needing to re-zip/re-whl files which have already been installed, leading to among other things useless I/O and whls inside zipapps which may differ from the distribution whls.
This bug arises because once the transition flag is set from lib (the default) to whl by a
py_whl_libraryas part of a venv's hub, that flag is never reset back to lib which needs to happen in order for sdist builds with dependencies to succeed. Sdist builds require that dependencies be installed, whl files do not suffice.Ideally we'd use Fabian's resettable targets from with_cfg.bzl, however using his resetters creates problems. So do the lame but obviously correct thing of handwriting equivalent transitions.
Changes are visible to end-users: no
Test plan
Repairs building all targets under a uv-defined hub, which was previously broken.