fix: allow pypi packages with empty data attribute#3463
fix: allow pypi packages with empty data attribute#3463rickeylev merged 3 commits intobazel-contrib:mainfrom
Conversation
Summary of ChangesHello @rickeylev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a specific build robustness issue related to Bazel's Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The change to add allow_empty = True to the data glob is correct and aligns with the goal of handling PyPI packages that might not have data files besides the Python code. However, the pull request is missing updates to the test suite, which will likely fail with this change. I've added a comment with details on how to fix the tests.
|
I think in reality |
…into fix.allow.empty.packages
|
Huh, interesting. Gemini warned that setting the attribute would cause a test failure. I wonder if it ran after CI was done and processed that? Or because it grokked the whole code base? In either case, it was right. That was legit impressive. |
|
Thanks, yeah, good point. I don't see how a valid wheel could trigger this. But it seems relatively innocuous to allow. |
An empty glob under site-packages (after excluding code and pyi files) is a bit strange,
but not actually incorrect. If such a situation occurs, it would cause a failure because
Bazel has since changed to disallow empty globs by default.
To fix, just set allow_empty=True on the data glob.