Development
How vinoWhisper is built, tested, packaged, and released. See CONTRIBUTING.md for the quick-start workflow.
Two Python environments
Section titled “Two Python environments”uv sync --extra export # full runtime + export toolchain (Python <3.14)
uv venvuv pip install --group dev # tests and linting only (~5s; used by CI)The dev group intentionally excludes OpenVINO (~400 MB) so unit tests run quickly in CI without hardware:
- Nothing under
tests/importsopenvino.transcriber.pyandserver.pyimport it lazily so tests can inject a fake pipeline. flaskandwerkzeugare indevfortests/test_server.py.requests(~100 KB pure Python) is indevbecausevinowhisper.captionimportsclient.pyat module scope, whichtests/test_caption.pyneeds during collection.- Pytest uses
pythonpath = ["."]to import directly from the source tree without installing the package (which would pull in OpenVINO).
Coverage measures full-package branch coverage with no omissions, including hardware-only paths (replay.py is the largest gap). CI enforces the threshold in ci.yml, posts per-file results to the job summary, and uploads coverage.xml. Rust jobs measure coverage with cargo llvm-cov and upload lcov.info.
Running your own build
Section titled “Running your own build”You can run directly from a git checkout across all three components:
| Component | Installed location | Redeploy after edits |
|---|---|---|
Python CLIs (caption, dictate, server, doctor, replay, setup) |
Editable .venv, symlinked into ~/.local/bin |
uv sync --extra export, then start a fresh process |
vinowhisper-tray |
Binary in ~/.local/bin |
Rebuild, install atomically, restart tray |
vinowhisper-gui (settings & sessions window) |
Binary in ~/.local/bin |
Rebuild and install atomically (launches fresh each time) |
Python
Section titled “Python”uv sync --extra exportuv run vinowhisper-setup # symlinks commands into ~/.local/binEdits take effect on the next process start:
- Stitcher and capture (
vinowhisper-caption): The tray spawns a fresh process whenever captions are shown; hide and show the overlay to pick up changes. - Dictation (
vinowhisper-dictate --json): The tray keeps one idle process running to avoid Python startup latency, so edits todictate.pyrequire restarting the tray. - Server (
vinowhisper-server): Runvinowhisper-server --stopso the next request starts the updated code (checkpgrep -af vinowhisper-captionfirst, as stopping kills active captions and incurs a model reload). pyproject.tomlchanges: Re-runuv sync, and re-runvinowhisper-setupif you added a new CLI entry point.
Tray and settings window (Rust)
Section titled “Tray and settings window (Rust)”cargo build --release --locked --manifest-path tray/Cargo.tomlcargo build --release --locked --manifest-path gui/Cargo.tomlfor b in tray gui; do install -m755 $b/target/release/vinowhisper-$b ~/.local/bin/vinowhisper-$b.part mv ~/.local/bin/vinowhisper-$b.part ~/.local/bin/vinowhisper-$bdoneInstall via a .part file and atomic mv so overwriting the running vinowhisper-tray binary does not fail with Text file busy. Then restart the tray:
pgrep -af vinowhisper-caption # active caption session exits with the trayvinowhisper-tray quitsetsid -f vinowhisper-tray >/dev/null 2>&1Only one tray runs per session (bound to $XDG_RUNTIME_DIR/vinowhisper-tray.sock); launching a second without quit forwards its command to the running instance and exits. Child caption and dictation processes exit automatically via PR_SET_PDEATHSIG.
Local builds link glibc (unlike the static musl release asset), which works on the machine that built them. Run VINOWHISPER_TRAY_TRACE=1 vinowhisper-tray to log dictation key and state transitions to stderr (never dictated text).
Verifying your active install
Section titled “Verifying your active install”ls -l ~/.local/bin/vinowhisper-* # Python symlinks into .venv; tray/gui timestampspgrep -af 'vinowhisper-(tray|caption|dictate)'If a change does not appear, an older tray or server process is almost always still running.
Checks
Section titled “Checks”uv run poe check # ruff check, ruff format --check, mypy, pytestuv run poe fix # ruff --fix and ruff formatuv run poe security # Bandit scan matching bandit.yml- mypy
python_version: Not pinned to3.11because NumPy’s type stubs use Python 3.12 syntax (type X = ...), which fails underpython_version = "3.11". Python 3.11 compatibility is enforced byrequires-pythonand Ruff’starget-version.ignore_missing_importsis enabled becauseopenvino_genaiships no stubs and is absent in CI. - Bandit skips: Configured in
[tool.bandit]:
| Check | Rationale |
|---|---|
B404 |
Flags import subprocess, which is core to invoking pw-record, parec, pactl, optimum-cli, and the local server |
B603 |
Every subprocess call passes a literal argv list with shell=False; dynamic values (PipeWire nodes, --target) are single elements |
B607 |
Tools like pw-record, parec, and pactl are installed in different paths across distros and are resolved with shutil.which |
B602 (shell=True) remains enabled and must stay clean.
Accessibility
Section titled “Accessibility”vinowhisper-gui enables eframe’s accesskit feature so it exposes an AT-SPI accessibility tree (disabling default features previously dropped it, leaving Orca with an empty window; found 2026-10-23). gui/ tests verify the AccessKit tree headlessly with egui_kittest:
- Every page is a focusable
Tabwith name and selected state, navigable viaTaband activated withEnter/Space. - Every control, list, and numeric field is linked to its label (
labelled_by), with no nameless focusable widgets (including egui scrollbars). - Section titles expose heading roles; model download status and reload refusals expose polite live regions.
- Light and dark themes pass WCAG 2.2 contrast ratios programmatically in the shared
vino-uicrate (4.5:1 for text; 3:1 for field borders, focus rings, and active-page tints). - At 2x zoom (
Ctrl++), the sidebar collapses into tabs without losing controls; at 1.5x and 3x, no control clips past the window edge. - Desktop text scaling sets initial zoom (#99): reads GNOME
text-scaling-factor(Settings portal orgsettings) or Plasma forced font DPI (>96) / general font size (>10pt), clamped to 1x–3x. Re-checked on focus gain and applied only if changed so manualCtrl+/Ctrl-adjustments persist.
Because the dictation pill is a click-through layer-shell surface with no accessibility tree, when a screen reader is active (org.a11y.Status.ScreenReaderEnabled) the tray mirrors failures, clipboard fallbacks, and cleanup notices as desktop notifications (#98). Live words and routine states (recording, transcribing, typed) are never sent.
The tray icon stays visually static while state is communicated in the tooltip (caption state and active dictation state, never dictated text). tray.rs tests verify menu item labels, check/radio states, and distinct state descriptions.
Verified 2026-10-23 on headless Sway with AT-SPI (python3-pyatspi): tree structure, names, and roles came through. Not tested: Orca speech output, GNOME/Plasma tray hosts, or the overlay itself (which has no accessibility tree). accesskit_atspi_common 0.14 reports disabled buttons as sensitive (upstream bug).
Packaging
Section titled “Packaging”[tool.setuptools] packages = ["vinowhisper"] is set explicitly because flat-layout auto-discovery fails when multiple top-level directories exist (tray/, gui/, settings/, and formerly systemd/; confirmed 2026-08-03).
Data files bundled inside the wheel:
model_digests.json:integrity.load_pins()falls back to “unpinned” if missing, sotests/test_integrity.pyverifies it is packaged and readable, and fails ifuv.lock’s export toolchain drifts further from the NPU pin.model_sources.json: Pinned Hugging Face commit and per-file SHA-256 hashes (hand-maintained from Hub LFS digests and file bytes). Missing it causes setup to refuse exporting; verified bytests/test_source.py.tray_release.jsonandgui_release.json: Generated only during release builds byscripts/pin_tray_release.pybeforeuv build(verified inrelease.yml). Absent in source checkouts sooverlay.availability()refuses unpinned downloads.
openvino-tokenizers is declared directly (even though openvino-genai pulls it in) because the NPU static pipeline hard-depends on it.
Flatpak packaging
Section titled “Flatpak packaging”packaging/flatpak/io.github.karanshukla.vinowhisper.yml builds the Flatpak bundle from the checkout (see install.md for build commands). Key implementation details:
- Bundled Python 3.13: Uses a pinned
python-build-standalonetarball becauseorg.freedesktop.Platform26.08 ships Python 3.14, which cannot run Whisper export. - Locked
requirements.txt: Generated fromuv.lockviascripts/flatpak_requirements.py(uv export+ lockedsetuptools) and installed withpip --require-hashes. Re-run after updatinguv.lock;tests/test_flatpak.pyenforces parity. - Global
no-debuginfo:flatpak-builder1.4.2’seu-stripcorrupted standalonepython3.13even whenno-debuginfowas set per-module (found 2026-11-14). Top-levelbuild-optionsdisable stripping manifest-wide; Cargo strips the Rust binaries itself. - Bytecode precompilation: The entire Python tree is compiled to
.pycduring build because/appis read-only (flatpak-builderaligns.pyctimestamps with ostree). flatpak-spawncleanup:launch.ensureandrestartsendSIGKILLtoflatpak-spawnonce the spawned server or tray answers; otherwiseflatpak-spawnstays alive and holds calling pipes open until the server idles out (e.g.,flatpak run --command=vinowhisper-transcribe … | grep;SIGKILLis required becauseflatpak-spawnforwards catchable signals).- Build cache order: Rust modules build before Python so Python edits rebuild in seconds.
- Shared Intel driver modules: Version-matched with
vinoSearchso both Flatpaks share one NPU stack; update them together. - Network build:
pipandcargofetch hash-verified locks at build time (--share=network), so the manifest is not Flathub-offline. - App ID & exports: Uses the tray’s
APP_IDso global shortcut portal entries carry over; the session MIME package is renamed to<id>.xmlas required by Flatpak export rules.
Version reporting (release vs. dev): --version, vinowhisper-doctor, and Settings → About report the version number for release builds and dev for source builds (so tools like vinoPilot can distinguish them). Rust binaries stamp VINOWHISPER_VERSION at build time (settings/src/version.rs enforces a match with Cargo.toml). Python inspects PEP 610 direct_url.json at runtime (vinowhisper/version.py: directory/git installs report dev, wheels report the version; release Flatpak builds write /app/lib/vinowhisper/release-version). Overlay pins and pip constraints always use vinowhisper.__version__.
packaging/flatpak/smoke.sh (run by flatpak.yml) verifies every CLI’s --help, version parity across Rust and Python, OpenVINO CPU enumeration, exported desktop entries, and cross-sandbox server startup.
Sandbox-specific behavior is gated on /.flatpak-info (vinowhisper/sandbox.py, settings/src/sandbox.rs): shared runtime dir, flatpak-spawn for server/tray restarts, Background portal autostart, updater command, and export venv path.
Overlay Rust dependencies
Section titled “Overlay Rust dependencies”All crates in tray/Cargo.toml are pure Rust so the binary links only libc (see tray.md):
| Crate | Purpose |
|---|---|
smithay-client-toolkit |
Pure-Rust Wayland client (wlr-layer-shell, SHM buffers, event loop; no libwayland or xkbcommon) |
cosmic-text |
Text shaping, wrapping, glyph rasterization, and direct fontconfig file parsing (no libfontconfig) |
ksni |
StatusNotifierItem tray icon over D-Bus |
vino-ui |
Shared tray menu icons (default-features = false, without egui) |
ashpd |
Global shortcuts and dictation typing/clipboard via xdg-desktop-portal |
rustix |
Signals, PR_SET_PDEATHSIG, keymap memfd, and CLOCK_BOOTTIME timerfd |
rust-version = "1.95" is set by vino-ui (matching gui/; cosmic-text 0.19 alone requires 1.89) and checked by CI’s msrv job.
Shell completion
Section titled “Shell completion”vinowhisper-setup installs scripts/vinowhisper-completion.bash. To install manually without root:
mkdir -p ~/.local/share/bash-completion/completionsln -sf "$PWD/scripts/vinowhisper-completion.bash" \ ~/.local/share/bash-completion/completions/vinowhisper-captionfor c in server replay doctor setup; do ln -sf vinowhisper-caption ~/.local/share/bash-completion/completions/vinowhisper-$cdonebash-completion lazy-loads completions by command name, which requires one symlink per command. Completions apply to vinowhisper-* directly, not uv run vinowhisper-* (where uv owns completion). Completing --target invokes vinowhisper-caption --list-targets from PATH (~0.2s Python startup per Tab press; avoids COMP_WORDS[0] in case of relative paths).
Conventions
Section titled “Conventions”- Minimal comments: Extract helpers, name clearly, or pin invariants with tests before commenting, and cite governing tests from code (comment-style.md, verified by Doc Links CI). No module/class/function docstrings in
vinowhisper/or//!/item docs intray/src/. Put design rationale and measurements indocs/. - Dated measurements: Always attach dates to measured hardware or benchmark claims.
- Actionable errors: Error paths print distro-specific fix commands via
distro.remediation. - Hardware-free unit tests: Everything in
tests/runs without an NPU, audio server, or OpenVINO. - Characterization tests (
test_characterization_*): Pin counter-intuitive intentional behaviors (e.g., refusing--targeton PulseAudio, pre-mute sink monitors,Live.update(refresh=True)). Review carefully before modifying assertions.
CI workflows
Section titled “CI workflows”| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
Push, PR | uv lock --check, Ruff, mypy, pytest + coverage (Python 3.11–3.13), wheel smoke test (scripts/smoke_wheel.sh), shellcheck, Rust tests/coverage/MSRV, Doc Links citation check |
bandit.yml |
Push/PR to main, Mondays |
Bandit security scan uploaded to GitHub Code Scanning and enforced as a gate (matches poe security) |
audit.yml |
Mondays, lockfile changes | pip-audit on runtime/dev deps (warning-only on export extra due to transformers<5.4 advisories); cargo audit on all three Cargo locks |
deps-canary.yml |
Mondays, pyproject.toml/uv.lock changes |
Verifies the full OpenVINO/export dependency set not installed by PR CI |
release.yml |
v* tag push |
Builds static musl tray + wheel (smoke_wheel.sh), publishes to PyPI, creates GitHub Release, triggers Flatpak bundle |
flatpak.yml |
packaging/flatpak/ PRs, release.yml, manual dispatch |
Builds, installs, and smoke-tests (packaging/flatpak/smoke.sh) the Flatpak bundle; attaches .flatpak and .sha256 on tag builds |
Python 3.14 is excluded from the matrix (see install.md). shellcheck validates every script in scripts/. Overlay tests run headlessly in memory using temporary directories and scratch sockets.
Dependency canary (deps-canary.yml) runs three separate steps to isolate breakages:
uv sync --extra export(without--frozen) followed by OpenVINO import and device enumeration.optimum-cli env(catches valid resolves that fail on import, such as backtrackingoptimumto a pre-5.x release, as happened in Dependabot #24).uv lock --upgrade --dry-run(separates lockfile breakage from unresolvable upgrades).
(Before 2026-08-31 this job primarily caught pruned OpenVINO nightly wheels.)
Commits, documentation site, and releases
Section titled “Commits, documentation site, and releases”Commits follow Conventional Commits (feat:, fix:, docs:, ci:, etc.) for git-cliff changelog generation:
uv run bump-my-version bump minor # updates versions, commits, tags vX.Y.Zgit cliff -c cliff.toml --tag vX.Y.Z -o CHANGELOG.md # review and edit changeloggit push --follow-tagsPreview unreleased entries with git cliff --unreleased. bump-my-version updates pyproject.toml, tray/Cargo.toml, and tray/Cargo.lock together (tests/test_packaging.py fails if versions diverge).
Docs site (docs.vinowhisper.com): Built with Astro Starlight from site/. docs/ remains the source of truth; site/scripts/sync-docs.mjs copies pages into a gitignored build directory, extracts frontmatter titles from each file’s H1, and rewrites relative links. Preview locally with cd site && npm ci && npm run dev; CI verifies builds in the site job.
Release pipeline (release.yml on v* tag):
tray: Builds the static muslx86_64-unknown-linux-muslbinary (static-pie, 6.0 MB, measured 2026-09-12). Not uploaded to PyPI.build: Verifies tag matchespyproject.toml, pins binary SHA-256 digests into the wheel, builds sdist/wheel, verifies pins, runstwine check --strict, and extracts release notes from hand-editedCHANGELOG.md.pypi: Publishes wheel/sdist via PyPI Trusted Publishing (OIDC).github-release: Creates the release (gh release create --verify-tagwithGH_REPOset, since the job has no checkout, fixing the v0.3.0 issue) and attaches wheel, sdist, binaries, andSHA256SUMS.flatpak(flatpak.yml): Builds, smoke-tests, and attachesvinowhisper-x86_64.flatpakand.sha256(outsideSHA256SUMS, which is already generated). If this step fails, PyPI and the GitHub Release remain intact and the Flatpak workflow can be re-run manually with the tag.
Release safeguards:
- Minimal job permissions:
buildhas no token,pypiholds onlyid-token: write, and onlygithub-releasecan write to the repo. PyPI runs before GitHub Release so a failed PyPI upload allows deleting and re-cutting the tag. - Trusted Publishing: Uses short-lived GitHub OIDC tokens bound to this repo,
release.yml, and thepypienvironment (no stored API tokens). Update PyPI publisher settings before renaming the workflow or environment. - Tag-only publishing: No
workflow_dispatchtrigger;pypiandgithub-releasealso verifygithub.ref. - Pinned tooling and Renovate:
twine,bandit(bandit.ymlandpoe security), and the release Rust toolchain are pinned to exact versions. Renovate auto-merges onlydevPython dependencies after a 7-day stability window; Cargo crates and GitHub Actions require manual review, and runtime Python dependencies are excluded from Renovate.