-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement variant-specific patches #488
Conversation
Fromager now supports variant-specific patches in additional to versioned and unversioned patches. Variant-specific patches are in subfolders, e.g. `atches/test_pkg-1.0.2/cpu/005-cpuver.patch`. Patch files are sorted alphanumerically by their *base* name, not their full path. This allows users to sort versioned/unversioned and plain/variant patches as they like. Internal changes: `sources.patch_source()` now uses `PackageBuildInfo` to get patches. `patches_for_requirement()` has been removed. Fixes: python-wheel-build#486 Signed-off-by: Christian Heimes <[email protected]>
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.
LGTM!
I will leave it to @dhellmann for final approval and merging
pattern = f"{self.override_module_name}-*" | ||
prefix_len = len(pattern) - 1 | ||
version: Version | None | ||
pattern = f"{self.override_module_name}*" |
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.
This pattern is going to find patches for foo-bar
when it the module is foo
.
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.
Patch directories use module override names, so foo-bar
is normalized to foo_bar
.
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 added a test and fix in #493
Fix a problem introduced in python-wheel-build#488 that could cause packages with a prefix common to another package's full name to have their patches included when scanning for patches of the package with the shorter name. For example, with patches for both 'foo' and 'foo-bar' when patches for 'foo' are loaded they would have included patches for 'foo-bar'.
Fromager now supports variant-specific patches in additional to versioned and unversioned patches. Variant-specific patches are in subfolders, e.g.
atches/test_pkg-1.0.2/cpu/005-cpuver.patch
.Patch files are sorted alphanumerically by their base name, not their full path. This allows users to sort versioned/unversioned and plain/variant patches as they like.
Internal changes:
sources.patch_source()
now usesPackageBuildInfo
to get patches.patches_for_requirement()
has been removed.Fixes: #486