Skip to content

Conversation

@AbhinavPradeep
Copy link
Contributor

Summary

Added a has_binaries flag to the build spec. This helps differentiate between pure and non-pure Python wheels.

Description of changes

  1. Added a has_binaries flag to the BaseBuildSpecDict.
  2. Macaron now defers from generating a dockerfile for non-pure wheels.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 13, 2026
@behnazh-w behnazh-w marked this pull request as ready for review January 13, 2026 11:18
@behnazh-w behnazh-w self-requested a review as a code owner January 13, 2026 11:18
@behnazh-w behnazh-w changed the title feat: include has_binaries flag feat: include has_binaries flag in build spec Jan 13, 2026
@behnazh-w behnazh-w changed the base branch from main to abhinav/fix-gen-build-spec-bugs January 13, 2026 11:19
Copy link
Member

@behnazh-w behnazh-w left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#: 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
Copy link
Member

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:

Copy link
Contributor Author

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

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
Copy link
Member

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.

Copy link
Contributor Author

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.

@behnazh-w behnazh-w changed the base branch from abhinav/fix-gen-build-spec-bugs to main January 15, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants