Repository navigation
fix(sources): allow sdist hooks with source config #1456
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| PurlConfig, | ||
| VariantInfo, | ||
| ) | ||
| from ._resolver import BuildSDist | ||
| from ._templates import _resolve_template, substitute_template | ||
| from ._typedefs import Annotations, PackageVersion, PatchMap, Template, Variant | ||
|
|
||
|
|
@@ -52,6 +53,22 @@ def __init__(self, settings: Settings, ps: PackageSettings) -> None: | |
| self._plugin_module: types.ModuleType | typing.Literal[False] | None = False | ||
| self._patches: PatchMap | None = None | ||
| self._annotations: Annotations | None = None | ||
| self._validate_build_sdist_hook() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| def _validate_build_sdist_hook(self) -> None: | ||
| """Check the selected variant's hook before resolution or download.""" | ||
| source_resolver = self.source_resolver | ||
| if ( | ||
| source_resolver is None | ||
| or source_resolver.build_sdist is not BuildSDist.hook | ||
| ): | ||
| return | ||
| hook = overrides.find_override_method(self.package, "build_sdist") | ||
| if not callable(hook): | ||
| raise ValueError( | ||
| f"{self.package}: source.build_sdist='hook' requires a callable " | ||
| "build_sdist override hook" | ||
| ) | ||
|
|
||
| @property | ||
| def package(self) -> NormalizedName: | ||
|
|
||
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.
Script executed:
Repository: python-wheel-build/fromager
Length of output: 18434
Script executed:
Repository: python-wheel-build/fromager
Length of output: 5177
Web query:
python-wheel-build fromager 0.103.0 0.103.1 source BuildSDist enum hook release githubResult:
Script executed:
Repository: python-wheel-build/fromager
Length of output: 5864
Move this guidance to the 0.104.0 note.
The 0.103.0 note implies that
build_sdist: hookis available in that release, but 0.103.0 does not support it. Move the guidance into the 0.104.0 note.Suggested fix