From 46e0b991cd0c08e1095a7db0b9beb2c22af999fb Mon Sep 17 00:00:00 2001 From: kamilbenkirane Date: Fri, 10 Apr 2026 16:39:30 +0200 Subject: [PATCH] fix: drop call-arg exclusion from internal modality/provider mypy overrides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After #256 fixed total=False on the modality Parameters TypedDicts, the call-arg exclusion in the big internal [[tool.mypy.overrides]] block (modalities.*.client / streaming / providers, providers.*, namespaces.domains) is no longer needed for the Unpack[*Parameters] pattern that originally required it. Removing it surfaced one previously-hidden real bug: GoogleImagesClient.model_post_init() forgot to forward self.base_url to the strategy client constructor (Gemini/Imagen). The wrapper would honor a custom base_url, but the strategy would silently default to None. Pass base_url=self.base_url at the call site. Also tightens the override surface: 6 disabled error codes instead of 7 on the same module list. The remaining codes (override, return-value, arg-type, assignment, no-any-return, attr-defined) cover the provider-mixin / multiple-inheritance typing patterns and are unrelated to #256. The tests.* override keeps call-arg disabled — 39 test files still construct provider clients without explicit base_url= and this PR intentionally leaves test ergonomics alone. Closes #257 --- pyproject.toml | 2 +- src/celeste/modalities/images/providers/google/client.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index caf902c..f82578e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -182,7 +182,7 @@ module = [ "celeste.providers.*.*", "celeste.namespaces.domains", ] -disable_error_code = ["override", "return-value", "arg-type", "call-arg", "assignment", "no-any-return", "attr-defined"] +disable_error_code = ["override", "return-value", "arg-type", "assignment", "no-any-return", "attr-defined"] [tool.bandit] exclude_dirs = [".venv", "__pycache__"] diff --git a/src/celeste/modalities/images/providers/google/client.py b/src/celeste/modalities/images/providers/google/client.py index 49b101f..5699c81 100644 --- a/src/celeste/modalities/images/providers/google/client.py +++ b/src/celeste/modalities/images/providers/google/client.py @@ -39,6 +39,7 @@ def model_post_init(self, __context: object) -> None: model=self.model, provider=self.provider, auth=self.auth, + base_url=self.base_url, ) object.__setattr__(self, "_strategy", strategy)