Skip to content
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

Automatically insert __init__.py files when building wheels. #394

Closed
awbraunstein opened this issue Dec 22, 2020 · 5 comments
Closed

Automatically insert __init__.py files when building wheels. #394

awbraunstein opened this issue Dec 22, 2020 · 5 comments
Labels
Can Close? Will close in 30 days if there is no new activity

Comments

@awbraunstein
Copy link

🚀 feature request

Relevant Rules

py_wheel

Description

Bazel doesn't require any __init__.py files and adds those automatically. When building a py_wheel, it would be useful if __init__.py files could be automatically inserted to allow the wheel to be used without significant modification to the bazel repository.

Describe the solution you'd like

I implemented this by doing this in the wheelmaker.py file by tracking what files are added and what directories need __init__.py files added that weren't provided. Then at the very end before writing the record, I add all the empty __init__.py files to the zip and record.

Describe alternatives you've considered

My solution above was my workaround.

@aaliddell
Copy link
Contributor

The auto addition of init files is intended to be disabled and removed at some point, as it has ended up causing more issues than expected: bazelbuild/bazel#7386

I would suggest either manually making the init files where necessary (as you would in any other python packaging outside Bazel) or should this be added to rules_python that the default be having it disabled.

@pstradomski
Copy link
Collaborator

pstradomski commented Dec 23, 2020 via email

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!

@github-actions github-actions bot added the Can Close? Will close in 30 days if there is no new activity label Jun 21, 2021
@thundergolfer
Copy link
Collaborator

@awbraunstein this has just recently been marked for closure. Do you perceive a need to keep this open, or are you satisfied that manual __init__.py is the best way forward?

@awbraunstein
Copy link
Author

No, you can keep this closed. I ended up implementing a manual solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? Will close in 30 days if there is no new activity
Projects
None yet
Development

No branches or pull requests

4 participants