Uh oh!
There was an error while loading. Please reload this page.
fix: google-cloud-audit-log wheel installs unintended top-level docs package - #17271
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the setup.py configuration for the google-cloud-audit-log package to restrict package discovery. Specifically, it configures find_namespace_packages to only include packages matching google* and explicitly exclude docs* alongside the existing exclusions for tests. Additionally, a unit test has been added to verify that the docs package is not discovered during setup. I have no feedback to provide as there are no review comments.
09e4980 to
0af3f88Comparegoogle-cloud-audit-log wheel installs unintended top-level docs packagegoogle-cloud-audit-log wheel installs unintended top-level docs packageThe CI unit test environments do not keep setuptools installed at runtime, even though the package is installed before tests run. Inspect the installed google-cloud-audit-log metadata instead of executing setup.py and monkeypatching setuptools.setup.
namefreezers
commented
May 27, 2026
@parthea Sorry, I accidentally unassigned myself from the PR. This wasn't intentional. Please assign me back if it is needed. |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes#17270 🦕
This PR fixes google-cloud-audit-log packaging so the wheel no longer installs an unintended top-level docs/conf.py file into site-packages.
The issue was caused by broad namespace package discovery in setup.py, which allowed the repository’s top-level docs/ directory to be discovered as an installable package. This changes package discovery to include only the intended google* namespace while continuing to exclude test/doc-related paths. I also added a regression test that runs the real setup.py, captures the discovered packages, and asserts that google.cloud.audit is included while docs is not.
I verified the built wheel locally and confirmed it contains only google/cloud/audit/... runtime files plus dist-info metadata, with no docs/conf.py. This prevents confusing stray files in virtual environments and avoids potential collisions with other top-level docs packages.
Check which I ran: