Skip to content

fix: declare click, typing-extensions, websocket-client as deps - #26

Merged
teeler merged 1 commit into
googlecolab:mainfrom
teeler:fix-missing-deps
May 27, 2026
Merged

teeler merged 1 commit into
googlecolab:mainfrom
teeler:fix-missing-deps

Conversation

@teeler

@teeler teeler commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Three first-party imports were relying on transitive dependencies that no longer resolve when installing from PyPI:

  • click (used by cli.py and commands/files.py) was being pulled in by older typer versions. typer 0.25.x dropped the explicit click dependency, so a fresh pip install google-colab-cli==0.5.4 resolves typer==0.25.1 which does NOT install click, and colab version fails immediately with ModuleNotFoundError: No module named 'click'.
  • typing_extensions was pulled in transitively by typer/pydantic.
  • websocket (the websocket-client package, used by runtime.py) was pulled in by jupyter-kernel-client.

All three are real first-party dependencies and should be declared.

Why now

I tested the live 0.5.4 install on PyPI in a clean venv as a sanity check ahead of the first OSS Exit Gate release, and colab version crashed on import. This bug exists on main today as well (PR #25 only changed cloudbuild.yaml).

Verification

  • uv pip install google-colab-cli==0.5.4 (PyPI):
    $ colab version
    Traceback (most recent call last):
      ...
    ModuleNotFoundError: No module named 'click'
    
  • Built a wheel from this branch, installed into a fresh venv:
    $ colab version
    Version: 0.5.6.dev0+...
    
  • uv run pytest tests/ — 198 passed
  • uv run ruff check . — clean

Follow-ups (not in this PR)

pytest, pytest-cov, pytest-mock are listed in runtime dependencies but should be in the dev group — they bloat every install with test machinery users don't need. Worth a separate cleanup PR.

Three first-party imports were relying on transitive dependencies that
no longer resolve cleanly when installing from PyPI:

- `click` (used by cli.py and commands/files.py) was being pulled in
  by older typer versions; typer 0.25.x dropped the explicit click
  dependency. With a clean `pip install google-colab-cli==0.5.4`,
  uv now resolves typer==0.25.1 which does NOT install click, and
  `colab version` fails immediately with
    ModuleNotFoundError: No module named 'click'
- `typing_extensions` (used in commands/automation.py and others)
  was pulled in transitively by typer/pydantic; same fragility.
- `websocket` (the websocket-client package; used by runtime.py via
  the kernel client) was pulled in by jupyter-kernel-client; not
  guaranteed.

Verified by building a wheel and installing into a fresh venv:
- Before: `colab version` -> ModuleNotFoundError: 'click'
- After:  `colab version` -> prints version string cleanly.

All 198 tests still pass; ruff clean.

Discovered while validating the live 0.5.4 install on PyPI ahead of
the first OSS Exit Gate release.
@teeler
teeler requested a review from sethtroisi May 26, 2026 22:52
@wh1ter4bb1t-js
wh1ter4bb1t-js requested review from wh1ter4bb1t-js and removed request for sethtroisi May 27, 2026 16:16
@teeler
teeler merged commit 2ea1eb2 into googlecolab:main May 27, 2026
6 checks passed
@teeler
teeler deleted the fix-missing-deps branch May 27, 2026 16:27
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