Skip to content

fix(gapic-generator): restrict package discovery to gapic* namespace - #18030

Merged
ohmayr merged 1 commit into
mainfrom
fix-gapic-generator-namespace-discovery
Aug 7, 2026
Merged

fix(gapic-generator): restrict package discovery to gapic* namespace#18030
ohmayr merged 1 commit into
mainfrom
fix-gapic-generator-namespace-discovery

Conversation

@ohmayr

@ohmayr ohmayr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Previously, setup.py called setuptools.find_namespace_packages(exclude=["docs", "tests"]) without wildcard glob patterns.
When CI (run_single_test.sh) or local test runners created temporary virtual environments (such as .venv-profiler or .nox), setuptools mistook those hidden directories for library packages and attempted to package their contents, causing pip install -e . and CI profiling jobs to fail or take too long.

Fix

This PR updates exclude in setup.py to use wildcard glob patterns:

packages=setuptools.find_namespace_packages(
    exclude=["docs*", "tests*", "testing*", ".*", "bazel*", "rules_python_gapic*"]
),

@ohmayr
ohmayr requested a review from a team as a code owner August 7, 2026 21:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the package discovery in setup.py to use an explicit inclusion pattern (gapic*) instead of excluding specific directories. The reviewer recommends refining this pattern to ["gapic", "gapic.*"] to prevent accidentally matching unrelated directories or virtual environments starting with gapic.

Comment thread packages/gapic-generator/setup.py Outdated
@ohmayr
ohmayr force-pushed the fix-gapic-generator-namespace-discovery branch 2 times, most recently from 062f900 to fe7cfee Compare August 7, 2026 21:06
@ohmayr
ohmayr force-pushed the fix-gapic-generator-namespace-discovery branch from fe7cfee to 0f233c1 Compare August 7, 2026 21:07

@hebaalazzeh hebaalazzeh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ohmayr
ohmayr enabled auto-merge (squash) August 7, 2026 21:30
@ohmayr
ohmayr merged commit b87776d into main Aug 7, 2026
104 checks passed
@ohmayr
ohmayr deleted the fix-gapic-generator-namespace-discovery branch August 7, 2026 21:51
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