Skip to content

fix(compat): avoid unconditional grpc import in v0.3 context builders#1006

Merged
ishymko merged 1 commit intomainfrom
ishymko/fix-grpc-import
Apr 22, 2026
Merged

fix(compat): avoid unconditional grpc import in v0.3 context builders#1006
ishymko merged 1 commit intomainfrom
ishymko/fix-grpc-import

Conversation

@ishymko
Copy link
Copy Markdown
Member

@ishymko ishymko commented Apr 22, 2026

Currently it causes no module named 'grpc' when using HTTP machinery.

Relevant "install and import" testing was extended to allow testing "extras" to catch this in the future.

@ishymko ishymko force-pushed the ishymko/fix-grpc-import branch from d2072ff to 59680c2 Compare April 22, 2026 07:25
Copy link
Copy Markdown
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 enhances the smoke testing suite by introducing installation profiles, allowing verification that specific extras like http-server can be imported without unnecessary dependencies. Key changes include updating the Python smoke test script to support multiple profiles and adding a shell script to automate the build and installation process in clean environments using uv. Feedback highlights a potential NameError in context_builders.py due to moving the grpc import into a TYPE_CHECKING block without enabling deferred annotation evaluation, and suggests a more robust method for identifying the built wheel in the shell script.

Comment thread src/a2a/compat/v0_3/context_builders.py Outdated
Comment thread scripts/test_install_smoke.sh
@ishymko ishymko force-pushed the ishymko/fix-grpc-import branch from 59680c2 to 9625293 Compare April 22, 2026 07:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/context_builders.py 92.00% 100.00% 🟢 +8.00%
Total 93.00% 93.02% 🟢 +0.02%

Generated by coverage-comment.yml

@ishymko ishymko force-pushed the ishymko/fix-grpc-import branch from 9625293 to d57f888 Compare April 22, 2026 07:29
@ishymko ishymko marked this pull request as ready for review April 22, 2026 07:33
@ishymko ishymko requested a review from a team as a code owner April 22, 2026 07:33
@ishymko ishymko merged commit 6b46ceb into main Apr 22, 2026
24 checks passed
@ishymko ishymko deleted the ishymko/fix-grpc-import branch April 22, 2026 07:36
ishymko added a commit that referenced this pull request Apr 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.0.1](v1.0.0...v1.0.1)
(2026-04-22)


### Bug Fixes

* **compat:** avoid unconditional grpc import in v0.3 context builders
([#1006](#1006))
([6b46ceb](6b46ceb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Ivan Shymko <ishymko@google.com>
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.

2 participants