Skip to content

Conversation

@mattem
Copy link
Collaborator

@mattem mattem commented Jun 2, 2022

Only take the DefaultInfo when there is no PyInfo. This stops us adding the source files from a rules_python / native py_library to the requirements file when installing wheels.

This is kinda a workaround that the upstream rules_python doesn't have a provider that can give a reference to the wheel, and we must get it from the DefaultInfo of a filegroup.

@mattem mattem requested a review from alexeagle June 2, 2022 01:53
elif DefaultInfo in filegroup:
elif DefaultInfo in filegroup and not PyInfo in filegroup:
# This is slightly incorrect, but we don't yet have a better way of knowing if the dependency is a filegroup
# that we should consume a wheel from.
Copy link
Member

Choose a reason for hiding this comment

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

file an issue on rules_python, if we think the right fix is to put more Info on these targets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah ideally the PyWheelInfo is removed from rules_py and added to rules_python, and the filegroup in the generated BUILD files for PyPi dependencies become the py_wheel rule.

@mattem mattem merged commit a2cd769 into main Jun 2, 2022
@mattem mattem deleted the fix/default_info_for_wheels_only branch June 2, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants