Allow virtual packages with --no-build (#12314)

## Summary

Closes #12311.
This commit is contained in:
Charlie Marsh 2025-03-22 09:00:02 -07:00 committed by GitHub
parent 149102a4e7
commit 7ac6c6963d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 157 additions and 16 deletions

View file

@ -2196,8 +2196,11 @@ impl Package {
};
}
if !no_build {
if let Some(sdist) = self.to_source_dist(workspace_root)? {
if let Some(sdist) = self.to_source_dist(workspace_root)? {
// Even with `--no-build`, allow virtual packages. (In the future, we may want to allow
// any local source tree, or at least editable source trees, which we allow in
// `uv pip`.)
if !no_build || sdist.is_virtual() {
return Ok(Dist::Source(sdist));
}
}