fix: exclude packages without artifacts from PEX lock file

- Add validation to only include packages with at least one artifact
- Skip packages that have no downloadable wheels or source distributions
- Prevents PEX parser error: "expected to have at least one artifact"

This ensures all locked requirements have valid downloadable artifacts
as required by the PEX specification.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Alessandro De Maria 2025-07-05 23:34:50 +00:00
parent f0a5b64b33
commit a884d5e84f

View file

@ -199,6 +199,8 @@ impl PexLock {
}
if let Some(version) = &package.id.version {
// Only include packages that have at least one artifact
if !artifacts.is_empty() {
// Collect dependencies for this package
let mut requires_dists = Vec::new();
for dep in &package.dependencies {
@ -221,6 +223,7 @@ impl PexLock {
});
}
}
}
let locked_resolves = vec![PexLockedResolve {
locked_requirements,