-
Notifications
You must be signed in to change notification settings - Fork 30
feat: include has_binaries flag in build spec #1278
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
Signed-off-by: Abhinav Pradeep <[email protected]>
Signed-off-by: Abhinav Pradeep <[email protected]>
Signed-off-by: Abhinav Pradeep <[email protected]>
Signed-off-by: Abhinav Pradeep <[email protected]>
behnazh-w
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.
Can you please add an integration test for a Python package that includes binaries, to test this new field in the spec?
| #: be a list of these that were used in building the wheel alongside their version. | ||
| build_backends: NotRequired[list[str]] | ||
|
|
||
| #: Flag to indicate if the artifact packages binaries |
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.
| #: Flag to indicate if the artifact packages binaries | |
| #: Flag to indicate if the artifact includes binaries. |
| except InvalidWheelFilename: | ||
| logger.debug("Could not parse wheel file name to extract version") | ||
| except SourceCodeError: | ||
| self.data["has_binaries"] = True |
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.
Why is this field set here? FYI, this is where we check that a Python package is pure:
if "any" in wheel_name_platforms:
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.
Currently I have it configured such that with pypi_package_json.wheel(): will throw SourceCodeError if a pure wheel cannot be found. This is because in the current analysis we would not want to analyze non-pure wheels right? So the way I set self.data["has_binaries"] now should be identical to setting it in
macaron/src/macaron/build_spec_generator/common_spec/pypi_spec.py
Lines 232 to 233 in ec37263
| if "any" in wheel_name_platforms: | |
| patched_build_commands = self.get_default_build_commands(self.data["build_tools"]) |
|
|
||
| try: | ||
| with pypi_package_json.wheel(): | ||
| self.data["has_binaries"] = False |
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'm not sure why self.data["has_binaries"] is set to False here.
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.
Same reason as for other the comment. We only succed a with pypi_package_json.wheel(): if we can find a pure wheel, and therfore on success we can set self.data["has_binaries"] = False.
Summary
Added a has_binaries flag to the build spec. This helps differentiate between pure and non-pure Python wheels.
Description of changes