diff --git a/CHANGELOG.md b/CHANGELOG.md index ba054c8..9db73c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/). +## [0.13.1] - 2026-06-07 + +### Fixed + +- Suppressed the spurious `googleapiclient.discovery_cache: file_cache is only supported with oauth2client<4.0.0` warning by passing `cache_discovery=False` when building the YouTube service. The file cache is incompatible with `google-auth` (which we use via `google-auth-oauthlib`); discovery docs are still cached in-memory for the life of the subprocess, which is all the dock's short-lived hook invocations need. + ## [0.13.0] - 2026-04-20 ### Added diff --git a/pyproject.toml b/pyproject.toml index 1baf6fc..4010660 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,14 @@ ignore_missing_imports = true module = "google.*" ignore_missing_imports = true +# ``google-auth`` ships without inline type hints — ``Credentials.refresh``, +# ``Credentials.from_authorized_user_file`` etc. all trip mypy's strict +# ``no-untyped-call`` check on newer mypy releases. Silence for our own +# auth module so CI and local environments agree regardless of mypy version. +[[tool.mypy.overrides]] +module = "reeln_google_plugin.auth" +disallow_untyped_calls = false + [[tool.mypy.overrides]] module = "google_auth_oauthlib.*" ignore_missing_imports = true diff --git a/reeln_google_plugin/__init__.py b/reeln_google_plugin/__init__.py index 19a0693..87d6ca1 100644 --- a/reeln_google_plugin/__init__.py +++ b/reeln_google_plugin/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -__version__ = "0.13.0" +__version__ = "0.13.1" from reeln_google_plugin.plugin import GooglePlugin diff --git a/reeln_google_plugin/auth.py b/reeln_google_plugin/auth.py index 3dc867f..82ccc32 100644 --- a/reeln_google_plugin/auth.py +++ b/reeln_google_plugin/auth.py @@ -67,7 +67,7 @@ def get_credentials( creds: Credentials | None = None if credentials_cache.exists(): - creds = Credentials.from_authorized_user_file( # type: ignore[no-untyped-call] + creds = Credentials.from_authorized_user_file( str(credentials_cache), effective_scopes ) @@ -107,4 +107,10 @@ def build_youtube_service(credentials: Any) -> Any: except ImportError as exc: raise AuthError(f"Google API client library not installed: {exc}") from exc - return build("youtube", "v3", credentials=credentials) + # ``cache_discovery=False`` suppresses the noisy + # ``file_cache is only supported with oauth2client<4.0.0`` warning. + # The file cache is incompatible with ``google-auth`` (we use it via + # ``google-auth-oauthlib``), and discovery docs are still cached + # in-memory for the life of the process — which is all we need given + # that each CLI hook invocation runs in a short-lived subprocess. + return build("youtube", "v3", credentials=credentials, cache_discovery=False) diff --git a/reeln_google_plugin/plugin.py b/reeln_google_plugin/plugin.py index 5a9e34f..06728c9 100644 --- a/reeln_google_plugin/plugin.py +++ b/reeln_google_plugin/plugin.py @@ -30,7 +30,7 @@ class GooglePlugin: """ name: str = "google" - version: str = "0.13.0" + version: str = "0.13.1" api_version: int = 1 config_schema: PluginConfigSchema = PluginConfigSchema( diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index c9720c1..17bebf5 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -273,7 +273,14 @@ def test_builds_service(self) -> None: result = build_youtube_service(fake_creds) assert result is mock_service - mock_build.assert_called_once_with("youtube", "v3", credentials=fake_creds) + # ``cache_discovery=False`` is intentional: silences the + # ``file_cache only supported with oauth2client<4.0.0`` warning. + mock_build.assert_called_once_with( + "youtube", + "v3", + credentials=fake_creds, + cache_discovery=False, + ) def test_import_error_raises_auth_error(self) -> None: with (