Skip to content

fix(voice): degrade gracefully when audio backend is unavailable - #1

Merged
lzsweb merged 3 commits into
mainfrom
fix/unit-tests-audio-backend
Nov 10, 2026
Merged

lzsweb merged 3 commits into
mainfrom
fix/unit-tests-audio-backend

Conversation

@lzsweb

@lzsweb lzsweb commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix CI unit-test failures where importing sounddevice raised PortAudioError (PulseAudio_Initialize: Can't connect to server) on runners without an audio server: offline voice tests now mock sounddevice.
  • tts.is_available() / voice.is_available() now return a friendly unavailable message on non-ImportError backend initialization failures instead of crashing.
  • Align the release-document check with the actual 1.0.0 release date (2026-11-10) and drop the stale ## [Released] assertion.
  • Disable matrix fail-fast for unit-tests and package-and-security so every Python version reports its own result.

Test plan

  • Local: pytest tests/ut — 3431 passed, 3 skipped
  • On top of github/main: targeted voice/docs/packaging tests — 100 passed, 2 skipped
  • GitHub Actions unit-tests (3.10–3.13) go green on this PR

zhansheng.lzs added 3 commits November 10, 2026 17:20
Mock sounddevice in offline voice tests instead of requiring a running
audio server on CI runners, and return a friendly unavailable message
when importing sounddevice fails with a non-ImportError backend error
such as PortAudioError. Align the release-document check with the actual
1.0.0 release date and disable matrix fail-fast so every Python version
reports its own result.
The clipboard settle timer can fire while the app is shutting down and
Textual has already unmounted widget component classes, so rendering
the screen raised KeyError. Stop watching instead of crashing, apply
Black's parameter formatting to the new voice tests, and cover the
shutdown race with a regression test.
Add a trusted-publishing (OIDC) pypi job to the tag workflow, gated by
a manually approved pypi environment, and document the one-time PyPI
setup plus the manual twine alternative. Prune the internal bench/
directory from the source distribution alongside md/ and cover both
exclusions in the packaging contract test.
@lzsweb
lzsweb merged commit fb84103 into main Nov 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant