Skip to content

Conversation

@tiran
Copy link
Collaborator

@tiran tiran commented Dec 2, 2025

Extend the resolver API with alternative download URLs. Resolvers can now return download links to alternative locations or retrieval methods.

The PyPIProvider now accepts a override_download_url parameter. The value overwrites the default PyPI download link. The string can contain a {version} format variable.

The GitHub and Gitlab tag providers can return git clone URLs for https and ssh transport. The URLs uses pip's VCS syntax like git+https://host/repo.git@tag.

The new enum RetrieveMethod has a from_url() constructor that parses an URL and splits it into method, url, and git ref.

@mergify mergify bot added the ci label Dec 2, 2025
@tiran tiran marked this pull request as ready for review December 3, 2025 11:25
@tiran tiran requested a review from a team as a code owner December 3, 2025 11:25
Extend the resolver API with alternative download URLs. Resolvers can
now return download links to alternative locations or retrieval methods.

The `PyPIProvider` now accepts a `override_download_url` parameter. The
value overwrites the default PyPI download link. The string can contain
a `{version}` format variable.

The GitHub and Gitlab tag providers can return git clone URLs for
`https` and `ssh` transport. The URLs uses pip's VCS syntax like
`git+https://host/repo.git@tag`.

The new enum `RetrieveMethod` has a `from_url()` constructor that parses
an URL and splits it into method, url, and git ref.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Copy link
Collaborator Author

@tiran tiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have addressed your review comments and added a new test case that covers unsupported scheme's in from_url.

@dhellmann
Copy link
Member

The PR message explains what the changes are, but not why they are useful. Why do we want this PR?

sdist_server_url: str,
ignore_platform: bool = False,
*,
override_download_url: str | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear how a caller would know what an alternative download site might be, and why that would be anything other than another package index server that could have been passed as the sdist_server_url parameter. What's the use case for using on package index to resolve a version and another server to act as the source of the download? Shouldn't the resolver look at the place where it's going to download the package to see what versions are available there?

@LalatenduMohanty
Copy link
Member

The code looks good to me. I see that @dhellmann has some review comments. So I will let him approve the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants