diff --git a/src/colab_cli/auto_update.py b/src/colab_cli/auto_update.py index e9aab3c..5158d42 100644 --- a/src/colab_cli/auto_update.py +++ b/src/colab_cli/auto_update.py @@ -42,7 +42,7 @@ def get_app_version() -> str: """Return the installed package version, falling back to the git short hash.""" try: - return installed_version("colab") + return installed_version("google-colab-cli") except (PackageNotFoundError, InvalidVersion): pass diff --git a/tests/test_version.py b/tests/test_version.py index 6d41b28..7ee0776 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -27,6 +27,10 @@ def test_version_installed(): result = runner.invoke(app, ["version"]) assert result.exit_code == 0 assert "Version: 0.2.0" in result.output + # Guard against a silent regression if the PyPI distribution name + # changes again: importlib.metadata.version() must be called with + # the distribution name exactly as it appears in pyproject.toml. + mock_version.assert_called_with("google-colab-cli") def test_version_git_fallback():