google-colab-cli 0.5.4__tar.gz → 0.5.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/PKG-INFO +4 -1
  2. google_colab_cli-0.5.6/cloudbuild.yaml +106 -0
  3. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/pyproject.toml +3 -0
  4. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/auto_update.py +1 -1
  5. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_version.py +4 -0
  6. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/uv.lock +6 -0
  7. google_colab_cli-0.5.4/cloudbuild.yaml +0 -73
  8. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/.githooks/pre-commit +0 -0
  9. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/.gitignore +0 -0
  10. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/.pre-commit-config.yaml +0 -0
  11. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/.python-version +0 -0
  12. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/AGENTS.md +0 -0
  13. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/COLAB_SKILL.md +0 -0
  14. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/CONTRIBUTING.md +0 -0
  15. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/LICENSE +0 -0
  16. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/README.md +0 -0
  17. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/01_session_management.md +0 -0
  18. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/02_execution_and_interactive.md +0 -0
  19. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/03_file_management.md +0 -0
  20. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/04_automation_and_utility.md +0 -0
  21. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/05_run_command.md +0 -0
  22. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/3042ab12-2026-05-07.png +0 -0
  23. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/docs/demos.md +0 -0
  24. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/README.md +0 -0
  25. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_keep_alive/test.sh +0 -0
  26. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_keep_alive_scope/test.sh +0 -0
  27. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_piped_console/test.sh +0 -0
  28. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_plot_redirection/test.sh +0 -0
  29. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_run_command/test.sh +0 -0
  30. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/integration/repro_variable_persistence/test.sh +0 -0
  31. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/auth.py +0 -0
  32. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/cli.py +0 -0
  33. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/client.py +0 -0
  34. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/__init__.py +0 -0
  35. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/automation.py +0 -0
  36. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/execution.py +0 -0
  37. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/files.py +0 -0
  38. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/run.py +0 -0
  39. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/session.py +0 -0
  40. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/commands/utility.py +0 -0
  41. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/common.py +0 -0
  42. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/console.py +0 -0
  43. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/contents.py +0 -0
  44. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/converter.py +0 -0
  45. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/history.py +0 -0
  46. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/repl.py +0 -0
  47. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/runtime.py +0 -0
  48. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/state.py +0 -0
  49. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/src/colab_cli/utils.py +0 -0
  50. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/conftest.py +0 -0
  51. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_auth.py +0 -0
  52. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_auth_adc.py +0 -0
  53. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_automation.py +0 -0
  54. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_cli.py +0 -0
  55. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_cli_log.py +0 -0
  56. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_client.py +0 -0
  57. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_console.py +0 -0
  58. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_contents.py +0 -0
  59. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_exec.py +0 -0
  60. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_history.py +0 -0
  61. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_ipynb_exec.py +0 -0
  62. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_keep_alive.py +0 -0
  63. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_log_export.py +0 -0
  64. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_pay.py +0 -0
  65. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_repl.py +0 -0
  66. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_resolution_logic.py +0 -0
  67. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_run.py +0 -0
  68. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_runtime.py +0 -0
  69. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_state.py +0 -0
  70. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_streaming.py +0 -0
  71. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_update.py +0 -0
  72. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_url.py +0 -0
  73. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_utils.py +0 -0
  74. {google_colab_cli-0.5.4 → google_colab_cli-0.5.6}/tests/test_whoami.py +0 -0
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-colab-cli
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Summary: CLI for interacting with Colab.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.13
7
+ Requires-Dist: click>=8.0
7
8
  Requires-Dist: google-auth-oauthlib>=1.3.0
8
9
  Requires-Dist: google-auth>=2.49.1
9
10
  Requires-Dist: jupyter-kernel-client
@@ -18,6 +19,8 @@ Requires-Dist: pytest>=9.0.2
18
19
  Requires-Dist: requests>=2.32.5
19
20
  Requires-Dist: rich>=14.3.3
20
21
  Requires-Dist: typer>=0.24.1
22
+ Requires-Dist: typing-extensions>=4.0
23
+ Requires-Dist: websocket-client>=1.0
21
24
  Description-Content-Type: text/markdown
22
25
 
23
26
  # Colab CLI
@@ -0,0 +1,106 @@
1
+ # Cloud Build pipeline triggered on git tag push.
2
+ #
3
+ # Builds an sdist + wheel for google-colab-cli using `uv build`, then publishes
4
+ # both to the OSS Exit Gate Artifact Registry repository:
5
+ # https://us-python.pkg.dev/oss-exit-gate-prod/google-colab-cli--pypi
6
+ # and triggers an Exit Gate release by uploading a manifest to:
7
+ # gs://oss-exit-gate-prod-projects-bucket/google-colab-cli/pypi/manifests/
8
+ #
9
+ # OSS Exit Gate consumes the artifacts from AR and publishes them to PyPI under
10
+ # the google-colab-cli project. See go/oss-exit-gate-release-python.
11
+ #
12
+ # The build runs against the tagged commit (TAG_NAME is set by the trigger).
13
+ # Version is derived from the git tag by hatch-vcs, so the checkout must have
14
+ # tags available (Cloud Build's default GitHub checkout includes them).
15
+ #
16
+ # Trigger: GitHub push to refs/tags/v* on googlecolab/google-colab-cli (main).
17
+ substitutions:
18
+ _AR_LOCATION: us
19
+ _AR_REPOSITORY: google-colab-cli--pypi
20
+ _AR_PROJECT: oss-exit-gate-prod
21
+ _EG_PROJECT_NAME: google-colab-cli
22
+ _EG_REGISTRY: pypi
23
+ _EG_TRIGGER_BUCKET: oss-exit-gate-prod-projects-bucket
24
+
25
+ steps:
26
+ # 1. Ensure hatch-vcs sees the tag. Cloud Build's default GitHub checkout
27
+ # is shallow and may omit tag refs; unshallow + force-fetch tags so
28
+ # `git describe` returns the clean tag (e.g. v0.5.5 -> 0.5.5) rather
29
+ # than a dev-suffixed pseudo-version.
30
+ - id: show-version
31
+ name: gcr.io/cloud-builders/git
32
+ entrypoint: bash
33
+ args:
34
+ - -c
35
+ - |
36
+ set -e
37
+ git fetch --tags --force --unshallow 2>/dev/null || git fetch --tags --force
38
+ echo "TAG_NAME=${TAG_NAME}"
39
+ echo "git describe: $(git describe --tags --always)"
40
+
41
+ # 2. Build sdist + wheel into dist/ using uv.
42
+ # Use the non-slim bookworm variant: hatch-vcs derives the version
43
+ # by shelling out to `git describe`, which requires a git binary
44
+ # in the build container. The -slim variant omits git and breaks
45
+ # the build with a setuptools-scm "not a git repository" error.
46
+ - id: build
47
+ name: ghcr.io/astral-sh/uv:python3.13-bookworm
48
+ entrypoint: bash
49
+ args:
50
+ - -c
51
+ - |
52
+ set -e
53
+ uv build
54
+ ls -la dist/
55
+
56
+ # 3. Publish artifacts to the OSS Exit Gate AR repository via twine + the
57
+ # google-artifactregistry-auth keyring plugin (uses ADC from the
58
+ # Cloud Build service account, which is registered as a builder in
59
+ # the project's project.txtpb).
60
+ - id: publish-to-ar
61
+ name: python:3.13-slim
62
+ entrypoint: bash
63
+ args:
64
+ - -c
65
+ - |
66
+ set -e
67
+ pip install --quiet --root-user-action=ignore \
68
+ twine keyrings.google-artifactregistry-auth
69
+ twine upload \
70
+ --repository-url "https://${_AR_LOCATION}-python.pkg.dev/${_AR_PROJECT}/${_AR_REPOSITORY}/" \
71
+ --verbose \
72
+ dist/*
73
+
74
+ # 4. Trigger the OSS Exit Gate release by uploading a manifest file to the
75
+ # project's GCS trigger bucket. `publish_all: true` tells the Exit Gate to
76
+ # publish every artifact currently in our AR repo, which is correct here
77
+ # because the trigger fires on a single tag push and only the artifacts
78
+ # for that tag are in AR at this moment (Exit Gate auto-cleans on success).
79
+ #
80
+ # Note: this step runs in the same Cloud Build as the AR upload. This is
81
+ # fine for BCID L0 (no attestations). When/if we move to BCID L1+ this
82
+ # must be split into a separate build that fires after this one succeeds;
83
+ # see go/oss-exit-gate-faq#why-manifest.
84
+ - id: trigger-release
85
+ name: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
86
+ entrypoint: bash
87
+ args:
88
+ - -c
89
+ - |
90
+ set -e
91
+ MANIFEST="${_EG_PROJECT_NAME}-${TAG_NAME}.json"
92
+ echo '{"publish_all": true}' > "$${MANIFEST}"
93
+ echo "Manifest contents:"
94
+ cat "$${MANIFEST}"
95
+ gcloud storage cp "$${MANIFEST}" \
96
+ "gs://${_EG_TRIGGER_BUCKET}/${_EG_PROJECT_NAME}/${_EG_REGISTRY}/manifests/$${MANIFEST}"
97
+
98
+ # Surface the built artifacts in the Cloud Build UI / logs.
99
+ artifacts:
100
+ objects:
101
+ location: gs://${PROJECT_ID}_cloudbuild/google-colab-cli/${TAG_NAME}
102
+ paths:
103
+ - dist/*
104
+
105
+ options:
106
+ logging: CLOUD_LOGGING_ONLY
@@ -5,6 +5,7 @@ description = "CLI for interacting with Colab."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
7
7
  dependencies = [
8
+ "click>=8.0",
8
9
  "google-auth>=2.49.1",
9
10
  "google-auth-oauthlib>=1.3.0",
10
11
  "jupyter-kernel-client",
@@ -19,6 +20,8 @@ dependencies = [
19
20
  "requests>=2.32.5",
20
21
  "rich>=14.3.3",
21
22
  "typer>=0.24.1",
23
+ "typing-extensions>=4.0",
24
+ "websocket-client>=1.0",
22
25
  ]
23
26
 
24
27
  [project.scripts]
@@ -42,7 +42,7 @@ from colab_cli.state import Settings
42
42
  def get_app_version() -> str:
43
43
  """Return the installed package version, falling back to the git short hash."""
44
44
  try:
45
- return installed_version("colab")
45
+ return installed_version("google-colab-cli")
46
46
  except (PackageNotFoundError, InvalidVersion):
47
47
  pass
48
48
 
@@ -27,6 +27,10 @@ def test_version_installed():
27
27
  result = runner.invoke(app, ["version"])
28
28
  assert result.exit_code == 0
29
29
  assert "Version: 0.2.0" in result.output
30
+ # Guard against a silent regression if the PyPI distribution name
31
+ # changes again: importlib.metadata.version() must be called with
32
+ # the distribution name exactly as it appears in pyproject.toml.
33
+ mock_version.assert_called_with("google-colab-cli")
30
34
 
31
35
 
32
36
  def test_version_git_fallback():
@@ -306,6 +306,7 @@ wheels = [
306
306
  name = "google-colab-cli"
307
307
  source = { editable = "." }
308
308
  dependencies = [
309
+ { name = "click" },
309
310
  { name = "google-auth" },
310
311
  { name = "google-auth-oauthlib" },
311
312
  { name = "jupyter-kernel-client" },
@@ -320,6 +321,8 @@ dependencies = [
320
321
  { name = "requests" },
321
322
  { name = "rich" },
322
323
  { name = "typer" },
324
+ { name = "typing-extensions" },
325
+ { name = "websocket-client" },
323
326
  ]
324
327
 
325
328
  [package.dev-dependencies]
@@ -329,6 +332,7 @@ dev = [
329
332
 
330
333
  [package.metadata]
331
334
  requires-dist = [
335
+ { name = "click", specifier = ">=8.0" },
332
336
  { name = "google-auth", specifier = ">=2.49.1" },
333
337
  { name = "google-auth-oauthlib", specifier = ">=1.3.0" },
334
338
  { name = "jupyter-kernel-client", git = "https://github.com/googlecolab/jupyter-kernel-client.git" },
@@ -343,6 +347,8 @@ requires-dist = [
343
347
  { name = "requests", specifier = ">=2.32.5" },
344
348
  { name = "rich", specifier = ">=14.3.3" },
345
349
  { name = "typer", specifier = ">=0.24.1" },
350
+ { name = "typing-extensions", specifier = ">=4.0" },
351
+ { name = "websocket-client", specifier = ">=1.0" },
346
352
  ]
347
353
 
348
354
  [package.metadata.requires-dev]
@@ -1,73 +0,0 @@
1
- # Cloud Build pipeline triggered on git tag push.
2
- #
3
- # Builds an sdist + wheel for colab-cli using `uv build`, then publishes both
4
- # to the Artifact Registry Python repository at
5
- # us-central1-python.pkg.dev/colab-cli-external/colab-cli/
6
- #
7
- # The build runs against the tagged commit (TAG_NAME is set by the trigger).
8
- # Version is derived from the git tag by hatch-vcs, so the checkout must have
9
- # tags available (Cloud Build's default GitHub checkout includes them).
10
- #
11
- # Trigger: GitHub push to refs/tags/v* on googlecolab/google-colab-cli (main).
12
- substitutions:
13
- _AR_LOCATION: us-central1
14
- _AR_REPOSITORY: colab-cli
15
- _AR_PROJECT: colab-cli-external
16
-
17
- steps:
18
- # 1. Ensure hatch-vcs sees the tag. Cloud Build's default GitHub checkout
19
- # is shallow and may omit tag refs; unshallow + force-fetch tags so
20
- # `git describe` returns the clean tag (e.g. v0.4.0 -> 0.4.0) rather
21
- # than a dev-suffixed pseudo-version.
22
- - id: show-version
23
- name: gcr.io/cloud-builders/git
24
- entrypoint: bash
25
- args:
26
- - -c
27
- - |
28
- set -e
29
- git fetch --tags --force --unshallow 2>/dev/null || git fetch --tags --force
30
- echo "TAG_NAME=${TAG_NAME}"
31
- echo "git describe: $(git describe --tags --always)"
32
-
33
- # 2. Build sdist + wheel into dist/ using uv.
34
- # Use the non-slim bookworm variant: hatch-vcs derives the version
35
- # by shelling out to `git describe`, which requires a git binary
36
- # in the build container. The -slim variant omits git and breaks
37
- # the build with a setuptools-scm "not a git repository" error.
38
- - id: build
39
- name: ghcr.io/astral-sh/uv:python3.13-bookworm
40
- entrypoint: bash
41
- args:
42
- - -c
43
- - |
44
- set -e
45
- uv build
46
- ls -la dist/
47
-
48
- # 3. Publish artifacts to Artifact Registry via twine + the
49
- # google-artifactregistry-auth keyring plugin (uses ADC from the
50
- # Cloud Build service account).
51
- - id: publish
52
- name: python:3.13-slim
53
- entrypoint: bash
54
- args:
55
- - -c
56
- - |
57
- set -e
58
- pip install --quiet --root-user-action=ignore \
59
- twine keyrings.google-artifactregistry-auth
60
- twine upload \
61
- --repository-url "https://${_AR_LOCATION}-python.pkg.dev/${_AR_PROJECT}/${_AR_REPOSITORY}/" \
62
- --verbose \
63
- dist/*
64
-
65
- # Surface the built artifacts in the Cloud Build UI / logs.
66
- artifacts:
67
- objects:
68
- location: gs://${PROJECT_ID}_cloudbuild/colab-cli/${TAG_NAME}
69
- paths:
70
- - dist/*
71
-
72
- options:
73
- logging: CLOUD_LOGGING_ONLY