fix: support both ColabKernelClient and KernelClient in runtime - #95
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Context & Background While setting up automated Google Colab workflows using Google Antigravity paired with Gemini 3.6 flash high, we encountered a runtime Upon investigating the dependency resolution, Gemini identified the root cause: a structural difference between the official PyPI release ( This PR adds dynamic attribute inspection in Verified against live Google Colab runtimes and passed the complete 322-test unit suite ( |
|
Thanks for the PR! |
Summary
Fixes an
AttributeErrorwhen runningcolab run/colab execcaused by attribute differences between PyPI releases ofjupyter-kernel-client(KernelClient) and the git repository fork (ColabKernelClient).Root Cause
jupyter-kernel-clientexportsKernelClient.jupyter-kernel-clientexportsColabKernelClient.pip install google-colab-clioruv tool install google-colab-cli,jupyter-kernel-clientfrom PyPI is resolved, causingAttributeError: module 'jupyter_kernel_client' has no attribute 'KernelClient'.Fix
Added dynamic attribute inspection in
ColabRuntime.kernel_clientto instantiateColabKernelClientwhen present and fall back toKernelClient. Updatedtest_runtime.pyunit tests accordingly.Testing
uv run pytest): 322/322 passed.colab runon Google Colab VM.