-
Notifications
You must be signed in to change notification settings - Fork 39
feat: add alternative download methods to resolver API #871
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
base: main
Are you sure you want to change the base?
Conversation
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>
tiran
left a comment
There was a problem hiding this 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.
|
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, |
There was a problem hiding this comment.
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?
|
The code looks good to me. I see that @dhellmann has some review comments. So I will let him approve the PR. |
Extend the resolver API with alternative download URLs. Resolvers can now return download links to alternative locations or retrieval methods.
The
PyPIProvidernow accepts aoverride_download_urlparameter. 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
httpsandsshtransport. The URLs uses pip's VCS syntax likegit+https://host/repo.git@tag.The new enum
RetrieveMethodhas afrom_url()constructor that parses an URL and splits it into method, url, and git ref.