Skip to content

feat(migrate/python): use BUILD.bazel for Python libraries#3893

Open
jskeet wants to merge 2 commits intogoogleapis:mainfrom
jskeet:use-bazel
Open

feat(migrate/python): use BUILD.bazel for Python libraries#3893
jskeet wants to merge 2 commits intogoogleapis:mainfrom
jskeet:use-bazel

Conversation

@jskeet
Copy link
Contributor

@jskeet jskeet commented Feb 5, 2026

Uses BUILD.bazel files on all APIs associated with a library to:

  • Pick up Python-specific GAPIC generator arguments
  • Pick up when rest_numeric_enums is false (specified in the same way)
  • Detect when the transport varies by API or is consistently not grpc+rest
  • Detect non-GAPIC API paths

Some of this may become obsolete due to #3897 but we can address that when everything has landed.

Fixes #3407.

@jskeet
Copy link
Contributor Author

jskeet commented Feb 5, 2026

(This will be a draft until #3890 is merged, at which point I'll rebase and there'll be a single commit when I request a review.)

Copy link
Contributor

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

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 introduces functionality to use BUILD.bazel files for configuring Python library generation during migration. The changes are well-implemented and include comprehensive tests. My feedback focuses on improving error handling by wrapping errors with more context to aid in debugging. Overall, the implementation is solid and aligns with the project's coding style.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 93.44262% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.47%. Comparing base (5d0221a) to head (750ecc0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
tool/cmd/migrate/python.go 93.44% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3893      +/-   ##
==========================================
+ Coverage   83.37%   83.47%   +0.09%     
==========================================
  Files          69       69              
  Lines        6173     6234      +61     
==========================================
+ Hits         5147     5204      +57     
- Misses        669      671       +2     
- Partials      357      359       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jskeet jskeet force-pushed the use-bazel branch 2 times, most recently from 2daaf02 to 2f867df Compare February 6, 2026 07:48
@jskeet jskeet marked this pull request as ready for review February 6, 2026 07:55
@jskeet jskeet requested a review from a team as a code owner February 6, 2026 07:55
@jskeet jskeet requested a review from zhumin8 February 6, 2026 07:55
@jskeet
Copy link
Contributor Author

jskeet commented Feb 6, 2026

@zhumin8: I'm definitely expecting to want to change this and the generator code together when your work on transports is done, but I'd like to get what I've got merged (as it does more than just transports) rather than have two moving targets to balance at the same time, if that's okay.

Uses BUILD.bazel files on all APIs associated with a library to:

- Pick up Python-specific GAPIC generator arguments
- Pick up when rest_numeric_enums is false (specified in the same way)
- Detect when the transport varies by API or is consistently not grpc+rest
- Detect non-GAPIC API paths
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.

tool/cmd/migrate: parse Python BUILD.bazel metadata

1 participant