-
Notifications
You must be signed in to change notification settings - Fork 39
Give the user an option to use predefined urls to download sdists from #164
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
Give the user an option to use predefined urls to download sdists from #164
Conversation
393008d to
87eb1ed
Compare
dhellmann
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.
Could you update https://github.com/python-wheel-build/fromager/blob/main/src/fromager/overrides.py#L131 as well, please, to include these new types of overrides.
| custom_download_urls = ctx.settings.url_to_download_sdist_from(req.name) | ||
| rename_to_template = ctx.settings.rename_sdist_to(req.name) | ||
|
|
||
| # don't include sdists if the user wants to download source from a predefined url |
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 why this change is related to having the URLs. Maybe because we're assuming there are no sdists for those cases? That happens to be true for some of the examples we have.
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.
If the user is providing a url from which they want to download the sdist then the url that the resolver returns for the source dist won't be used anyways
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.
Including or excluding specific formats influences the resolver, too. It will only return a version the distribution type we've asked for exists for that version.
I guess in most cases where we download source from an alternative location there isn't an sdist to use, so this is probably OK. We may end up wanting to expose options to control which types of distributions to consider, though. Let's deal with that in a separate PR. In fact, we may want to split the step for resolving the version from the step for downloading the source for that version.
It would be really good to see a functioning version of this PR with a real use case based on our downstream builds.
Sorry, I didn't quite understand what I should add here? |
|
I was thinking of doing something like this myself for two reasons:
|
12290b5 to
4b0d4ce
Compare
62ed16f to
4741cc6
Compare
| custom_download_urls = ctx.settings.url_to_download_sdist_from(req.name) | ||
| rename_to_template = ctx.settings.rename_sdist_to(req.name) | ||
|
|
||
| # don't include sdists if the user wants to download source from a predefined url |
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.
Including or excluding specific formats influences the resolver, too. It will only return a version the distribution type we've asked for exists for that version.
I guess in most cases where we download source from an alternative location there isn't an sdist to use, so this is probably OK. We may end up wanting to expose options to control which types of distributions to consider, though. Let's deal with that in a separate PR. In fact, we may want to split the step for resolving the version from the step for downloading the source for that version.
It would be really good to see a functioning version of this PR with a real use case based on our downstream builds.
Fixes #138
User can provide a mapping of package to download source url in
settings.yaml:User can define a predefined url for a package from which all its sources will be downloaded from. Optionally they can rename the downloaded sdist to whatever they want.
The only supported template variables are:
version.versionis replaced by the version returned by the resolver.