mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
fix: handle git dependencies without traditional filenames
- Add support for git dependencies that lack sdist filenames - Generate synthetic filenames for git URLs (e.g., package-version.tar.gz) - Include git dependencies with URLs like git+https://github.com/... - Fixes missing candidates for average-minimum-distance and pormake This ensures git-based dependencies are properly included in PEX lock files with appropriate filenames for PEX resolution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c21f999dda
commit
c59c008856
1 changed files with 12 additions and 4 deletions
|
@ -197,7 +197,15 @@ impl PexLock {
|
|||
let Some(sdist_url) = sdist.url().map(|u| u.to_string()) else {
|
||||
continue;
|
||||
};
|
||||
let Some(sdist_filename) = sdist.filename().map(|f| f.to_string()) else {
|
||||
|
||||
// Handle git dependencies that may not have traditional filenames
|
||||
let sdist_filename = if let Some(filename) = sdist.filename() {
|
||||
filename.to_string()
|
||||
} else if sdist_url.starts_with("git+") {
|
||||
// Generate a filename for git dependencies
|
||||
format!("{}-{}.tar.gz", package.id.name,
|
||||
package.id.version.as_ref().map(|v| v.to_string()).unwrap_or_else(|| "0.0.0".to_string()))
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
|
||||
|
@ -229,8 +237,8 @@ impl PexLock {
|
|||
{
|
||||
// Only exclude dependencies that are TRULY Windows-only:
|
||||
// - Have ONLY Windows wheels AND no source distribution
|
||||
let only_windows_wheels = !dep_package.wheels.is_empty() &&
|
||||
dep_package.wheels.iter().all(|wheel| {
|
||||
let only_windows_wheels = !dep_package.wheels.is_empty()
|
||||
&& dep_package.wheels.iter().all(|wheel| {
|
||||
wheel.filename.platform_tags().iter().any(|tag| {
|
||||
matches!(
|
||||
tag,
|
||||
|
@ -242,7 +250,7 @@ impl PexLock {
|
|||
})
|
||||
});
|
||||
let has_sdist = dep_package.sdist.is_some();
|
||||
|
||||
|
||||
// Include unless it's Windows-only (only Windows wheels and no sdist)
|
||||
let has_compatible_artifacts = !only_windows_wheels || has_sdist;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue