Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(uv): Universal wheel can't be added as URL dependency as it's mismatched to current platform #3338

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3332.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug in uv mode that direct URL dependencies can't be installed.
5 changes: 2 additions & 3 deletions src/pdm/resolver/uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ def hash_maker(item: dict[str, Any]) -> FileHash:
def hash_maker(item: dict[str, Any]) -> FileHash:
return {"file": Link(item["url"]).filename, "hash": item["hash"]}

if not req.is_file_or_url:
for wheel in chain(package.get("wheels", []), [sdist] if (sdist := package.get("sdist")) else []):
candidate.hashes.append(hash_maker(wheel))
for wheel in chain(package.get("wheels", []), [sdist] if (sdist := package.get("sdist")) else []):
candidate.hashes.append(hash_maker(wheel))
entry = Package(candidate, [make_requirement(dep) for dep in package.get("dependencies", [])], "")
packages.append(entry)
if optional_dependencies := package.get("optional-dependencies"):
Expand Down
Loading