Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: delete BUILD et al files from pypi sourced dependencies #3029

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

Merged
merged 9 commits into from
Jun 27, 2025

Conversation

rickeylev
Copy link
Collaborator

Sometimes wheels mistakenly contain BUILD files (or other special Bazel files).
When extracted, these interfere with how we expected the repo to look. In particular,
globs no longer match correctly because BUILD files create a Bazel package boundary.

To fix, delete these files. They aren't generally usable, since they can't know what
version of Bazel, rule_python, or similar, is consuming them.

Fixes #2782

@rickeylev rickeylev requested review from aignas and groodt as code owners June 25, 2025 20:21
@rickeylev rickeylev force-pushed the fix.pypi.rm.build.files branch from fce691e to 23cb11d Compare June 25, 2025 20:23
@rickeylev
Copy link
Collaborator Author

Ideas for testing this? Aside from checking in a pre-built whl (I'm very much against any checked in artifacts after what happened to xz)

Ah -- a repository rule to transform a file structure into a zip, to then pass onto whl_library? We can then define an entirely arbitrary layout of files verbatim and have it automatically turned into a wheel for testing.

@rickeylev rickeylev force-pushed the fix.pypi.rm.build.files branch from 3edab06 to 34a3090 Compare June 25, 2025 21:42
@rickeylev
Copy link
Collaborator Author

I added a helper to create a whl from a directory tree. This is really nice for testing whl_library!

We can now integration test arbitrary wheel file structures and contents without having to download anything.

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Nice!

Please remember to add a line in the CHANGELOG.

@rickeylev rickeylev added this pull request to the merge queue Jun 27, 2025
@rickeylev
Copy link
Collaborator Author

Changelog updated.

Merging.

Merged via the queue into bazel-contrib:main with commit 7719529 Jun 27, 2025
3 checks passed
@rickeylev rickeylev deleted the fix.pypi.rm.build.files branch July 1, 2025 21:24
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.

Delete BUILD files from extracted pypi dependencies
2 participants