fix: mypy errors from TTS language switching (#5) #8
Loading…
Reference in a new issue
No description provided.
Delete branch "devel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the mypy failures introduced in #5 that have been failing CI on every push since.
Root cause from
actions/runs/3984logs:Fixes:
utils.py:_lingua_detectorisLanguageDetectorin the success branch andNonein theImportErrorbranch — addedtype: ignore[assignment]on both assignments (runtime guard isLINGUA_AVAILABLE).base_openai_compatible_language_model.py:_chunk()checkedgetattr(self, "tts_*", None)for truthiness but then passedself.tts_supported_languages/self.tts_default_language(stillOptionalto mypy). Now captures to localstts_supported/tts_defaultviagetattrfirst, so the truthiness check narrows them.Verified:
uv run mypy src/→Success: no issues found in 101 source filesuv run ruff check src/ tests//ruff format --check src/ tests/→ clean9d1701a0cb7907581b4c