python-voiceio 1.17.1__tar.gz → 1.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_voiceio-1.17.1/python_voiceio.egg-info → python_voiceio-1.18.0}/PKG-INFO +5 -2
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/README.md +4 -1
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/pyproject.toml +1 -1
- {python_voiceio-1.17.1 → python_voiceio-1.18.0/python_voiceio.egg-info}/PKG-INFO +5 -2
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/python_voiceio.egg-info/SOURCES.txt +2 -0
- python_voiceio-1.18.0/tests/test_install_env.py +188 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_setup.py +87 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_sherpa.py +59 -3
- python_voiceio-1.18.0/voiceio/__init__.py +1 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/doctor.py +45 -3
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/catalog.py +22 -3
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/fetch.py +15 -6
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/health.py +2 -8
- python_voiceio-1.18.0/voiceio/install_env.py +169 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/platform.py +63 -8
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/service.py +24 -1
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/noninteractive.py +10 -3
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/steps.py +16 -1
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/system.py +6 -0
- python_voiceio-1.17.1/voiceio/__init__.py +0 -1
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/LICENSE +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/python_voiceio.egg-info/dependency_links.txt +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/python_voiceio.egg-info/entry_points.txt +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/python_voiceio.egg-info/requires.txt +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/python_voiceio.egg-info/top_level.txt +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/setup.cfg +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_announce.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_app_wiring.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_audio_quality.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_audio_source.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_backend_probes.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_cancel.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_cli.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_clipboard_read.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_clipboard_typer.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_commands.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_concurrency_lockdown.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_config.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_context_terms.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_corrections.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_dead_mic.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_decoders.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_errorlog.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_evdev_uaccess.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_fallback.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_fcitx_bridge.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_feedback_stream.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_focus.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_gpu_fallback.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_health.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_hints.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_history.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_hotkey_modes.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_engine_limits.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_engine_listener.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_pending.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_pids.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_ping.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_session.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_textlimit.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_ibus_typer.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_idle_audio.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_clean.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_import.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_language.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_metrics.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_pipeline.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_quiet.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_resume.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_review.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_learn_targets.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_llm.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_llm_api.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_mic_gain.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_modifier_guard.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_numbers.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_paste_last.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_pipeline.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_platform.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_postcorrect.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_postprocess.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_prebuffer.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_presence.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_prompt.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_quiet_audio.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_recorder_integration.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_report.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_retention.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_robustness.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_security_hardening.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_server.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_service.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_spool.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_streaming.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_suggest.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_tokens.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_transcriber.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_tray.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_tts.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_typer_manager.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_vad.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_vocabulary.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_wordfreq.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/tests/test_worker_decode.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/__main__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/announce.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/app.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/audio_source.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/backends.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/configcmd.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/corrections.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/history.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/learn.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/models.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/servicecmd.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/uninstall.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/cli/vocab.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/clipboard_read.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/commands.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/config.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/consent.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/context_terms.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/bias.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/base.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/lanes.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/sherpa.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/decoders/whispercpp.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/core/pipeline.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/corrections.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/data/60-voiceio-uaccess.rules +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/data/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/demo.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/display.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/errorlog.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/feedback.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/focus.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hints.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/history.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/base.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/chain.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/evdev.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/pynput_backend.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/hotkeys/socket_backend.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/install.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/pending.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/session.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ibus/textlimit.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/idle_audio.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/augment.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/clean.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/evaluate.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/importer.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/metrics.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/quiet.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/review.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/store.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/teacher.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/learn/train.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/llm.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/llm_api.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/mic_gain.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/models/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/models/silero_vad.onnx +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/numbers.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/pidlock.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/postcorrect.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/postprocess.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/power.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/presence.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/privacy.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/prompt.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/quiet_audio.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/recorder.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/report.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/retention.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/server/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/server/__main__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/server/app.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/server/config.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/server/runtime.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/configfile.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/extras.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/hotkey.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/speech.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/setup/ui.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/sounds/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/sounds/alert.wav +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/sounds/commit.wav +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/sounds/start.wav +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/sounds/stop.wav +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/spool.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/streaming.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/suggest.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tokens.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tray/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tray/_icons.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tray/_indicator.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tray/_pystray.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/base.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/chain.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/edge_engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/espeak.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/piper_engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/player.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/tts/supertonic_engine.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/__init__.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/base.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/chain.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/clipboard.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/collecting.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/fcitx_bridge.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/ibus.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/manager.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/modifier_guard.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/paste.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/pynput_type.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/wtype.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/xdotool.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/typers/ydotool.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/ui.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/vad.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/vocab_stats.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/vocabulary.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/watchdog.py +0 -0
- {python_voiceio-1.17.1 → python_voiceio-1.18.0}/voiceio/wordfreq.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.18.0
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -82,11 +82,14 @@ Install voiceio on this machine following https://voiceio.dev/llms.txt. Ask me w
|
|
|
82
82
|
sudo apt install pipx build-essential python3-dev portaudio19-dev ibus gir1.2-ibus-1.0 python3-gi # Debian/Ubuntu
|
|
83
83
|
sudo dnf install pipx gcc gcc-c++ make python3-devel portaudio-devel ibus ibus-libs python3-gobject # Fedora
|
|
84
84
|
sudo pacman -S python-pipx base-devel portaudio ibus python-gobject # Arch
|
|
85
|
+
sudo emerge --ask media-libs/portaudio app-i18n/ibus dev-python/pygobject # Gentoo
|
|
85
86
|
|
|
86
|
-
pipx install 'python-voiceio[desktop]'
|
|
87
|
+
pipx install 'python-voiceio[desktop]' # or: uv tool install 'python-voiceio[desktop]'
|
|
87
88
|
voiceio setup # model, hotkey, autostart
|
|
88
89
|
```
|
|
89
90
|
|
|
91
|
+
`uvx` is fine for a quick try, but run `voiceio setup` from a `pipx` or `uv tool` install: uvx runs from uv's cache, which uv deletes on `uv cache clean`, and the autostart service would point there.
|
|
92
|
+
|
|
90
93
|
**Or as a Debian/Ubuntu package** (new; bundles everything, nothing to compile):
|
|
91
94
|
|
|
92
95
|
```bash
|
|
@@ -29,11 +29,14 @@ Install voiceio on this machine following https://voiceio.dev/llms.txt. Ask me w
|
|
|
29
29
|
sudo apt install pipx build-essential python3-dev portaudio19-dev ibus gir1.2-ibus-1.0 python3-gi # Debian/Ubuntu
|
|
30
30
|
sudo dnf install pipx gcc gcc-c++ make python3-devel portaudio-devel ibus ibus-libs python3-gobject # Fedora
|
|
31
31
|
sudo pacman -S python-pipx base-devel portaudio ibus python-gobject # Arch
|
|
32
|
+
sudo emerge --ask media-libs/portaudio app-i18n/ibus dev-python/pygobject # Gentoo
|
|
32
33
|
|
|
33
|
-
pipx install 'python-voiceio[desktop]'
|
|
34
|
+
pipx install 'python-voiceio[desktop]' # or: uv tool install 'python-voiceio[desktop]'
|
|
34
35
|
voiceio setup # model, hotkey, autostart
|
|
35
36
|
```
|
|
36
37
|
|
|
38
|
+
`uvx` is fine for a quick try, but run `voiceio setup` from a `pipx` or `uv tool` install: uvx runs from uv's cache, which uv deletes on `uv cache clean`, and the autostart service would point there.
|
|
39
|
+
|
|
37
40
|
**Or as a Debian/Ubuntu package** (new; bundles everything, nothing to compile):
|
|
38
41
|
|
|
39
42
|
```bash
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.18.0
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -82,11 +82,14 @@ Install voiceio on this machine following https://voiceio.dev/llms.txt. Ask me w
|
|
|
82
82
|
sudo apt install pipx build-essential python3-dev portaudio19-dev ibus gir1.2-ibus-1.0 python3-gi # Debian/Ubuntu
|
|
83
83
|
sudo dnf install pipx gcc gcc-c++ make python3-devel portaudio-devel ibus ibus-libs python3-gobject # Fedora
|
|
84
84
|
sudo pacman -S python-pipx base-devel portaudio ibus python-gobject # Arch
|
|
85
|
+
sudo emerge --ask media-libs/portaudio app-i18n/ibus dev-python/pygobject # Gentoo
|
|
85
86
|
|
|
86
|
-
pipx install 'python-voiceio[desktop]'
|
|
87
|
+
pipx install 'python-voiceio[desktop]' # or: uv tool install 'python-voiceio[desktop]'
|
|
87
88
|
voiceio setup # model, hotkey, autostart
|
|
88
89
|
```
|
|
89
90
|
|
|
91
|
+
`uvx` is fine for a quick try, but run `voiceio setup` from a `pipx` or `uv tool` install: uvx runs from uv's cache, which uv deletes on `uv cache clean`, and the autostart service would point there.
|
|
92
|
+
|
|
90
93
|
**Or as a Debian/Ubuntu package** (new; bundles everything, nothing to compile):
|
|
91
94
|
|
|
92
95
|
```bash
|
|
@@ -44,6 +44,7 @@ tests/test_ibus_session.py
|
|
|
44
44
|
tests/test_ibus_textlimit.py
|
|
45
45
|
tests/test_ibus_typer.py
|
|
46
46
|
tests/test_idle_audio.py
|
|
47
|
+
tests/test_install_env.py
|
|
47
48
|
tests/test_learn_clean.py
|
|
48
49
|
tests/test_learn_import.py
|
|
49
50
|
tests/test_learn_language.py
|
|
@@ -109,6 +110,7 @@ voiceio/health.py
|
|
|
109
110
|
voiceio/hints.py
|
|
110
111
|
voiceio/history.py
|
|
111
112
|
voiceio/idle_audio.py
|
|
113
|
+
voiceio/install_env.py
|
|
112
114
|
voiceio/llm.py
|
|
113
115
|
voiceio/llm_api.py
|
|
114
116
|
voiceio/mic_gain.py
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"""uvx runs voiceio from uv's cache: setup must not bake those paths in, doctor
|
|
2
|
+
must flag them."""
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
from voiceio import install_env, service
|
|
9
|
+
|
|
10
|
+
TAG = "Signature: 8a477f597d28d172789f06886806bc55\n# This file is a cache directory tag.\n"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@pytest.fixture
|
|
14
|
+
def uv_cache(monkeypatch, tmp_path):
|
|
15
|
+
"""An uvx environment with a voiceio script, in a sandboxed uv cache."""
|
|
16
|
+
cache = tmp_path / "uv-cache"
|
|
17
|
+
env = cache / "archive-v0" / "AbCd123"
|
|
18
|
+
(env / "bin").mkdir(parents=True)
|
|
19
|
+
(env / "bin" / "voiceio").write_text("#!/bin/sh\n")
|
|
20
|
+
(cache / "CACHEDIR.TAG").write_text(TAG)
|
|
21
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(cache))
|
|
22
|
+
return env
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_cache_dir_follows_uv(monkeypatch, tmp_path):
|
|
26
|
+
monkeypatch.delenv("UV_CACHE_DIR", raising=False)
|
|
27
|
+
monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path / "xdg"))
|
|
28
|
+
assert install_env.uv_cache_dir() == tmp_path / "xdg" / "uv"
|
|
29
|
+
monkeypatch.setenv("XDG_CACHE_HOME", "relative/ignored")
|
|
30
|
+
assert install_env.uv_cache_dir() == Path.home() / ".cache" / "uv"
|
|
31
|
+
monkeypatch.delenv("XDG_CACHE_HOME")
|
|
32
|
+
assert install_env.uv_cache_dir() == Path.home() / ".cache" / "uv"
|
|
33
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "custom"))
|
|
34
|
+
assert install_env.uv_cache_dir() == tmp_path / "custom"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_paths_under_the_cache_dir_are_ephemeral_even_without_a_tag(monkeypatch, tmp_path):
|
|
38
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "c"))
|
|
39
|
+
assert install_env.in_uv_cache(tmp_path / "c" / "archive-v0" / "x" / "bin" / "voiceio")
|
|
40
|
+
assert not install_env.in_uv_cache(tmp_path / "elsewhere" / "bin" / "voiceio")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_a_tagged_cache_elsewhere_is_ephemeral(monkeypatch, tmp_path):
|
|
44
|
+
# `uvx --cache-dir DIR` or `--no-cache` (a temp dir): no env var says so,
|
|
45
|
+
# but uv tags every cache root.
|
|
46
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "default"))
|
|
47
|
+
other = tmp_path / "tmpcache"
|
|
48
|
+
(other / "archive-v0" / "x").mkdir(parents=True)
|
|
49
|
+
(other / "CACHEDIR.TAG").write_text(TAG)
|
|
50
|
+
assert install_env.in_uv_cache(other / "archive-v0" / "x")
|
|
51
|
+
(other / "CACHEDIR.TAG").write_text("not a cache tag\n")
|
|
52
|
+
assert not install_env.in_uv_cache(other / "archive-v0" / "x")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def test_persistent_installs_are_not_ephemeral(monkeypatch, tmp_path):
|
|
56
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "cache"))
|
|
57
|
+
for prefix in (tmp_path / ".local/share/uv/tools/python-voiceio",
|
|
58
|
+
tmp_path / ".local/share/pipx/venvs/python-voiceio"):
|
|
59
|
+
prefix.mkdir(parents=True)
|
|
60
|
+
monkeypatch.setattr(sys, "prefix", str(prefix))
|
|
61
|
+
assert not install_env.running_ephemeral()
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_service_install_refuses_a_uv_cache_binary(monkeypatch, tmp_path, uv_cache, capsys):
|
|
65
|
+
monkeypatch.setattr(sys, "prefix", str(uv_cache))
|
|
66
|
+
monkeypatch.setattr(service, "has_systemd", lambda: True)
|
|
67
|
+
monkeypatch.setattr(service, "_IS_WINDOWS", False)
|
|
68
|
+
monkeypatch.setattr(service, "SERVICE_DIR", tmp_path / "units")
|
|
69
|
+
monkeypatch.setattr(service, "SERVICE_PATH", tmp_path / "units" / service.SERVICE_NAME)
|
|
70
|
+
monkeypatch.setattr(service, "LEARN_SERVICE_PATH", tmp_path / "units" / "l.service")
|
|
71
|
+
monkeypatch.setattr(service, "LEARN_TIMER_PATH", tmp_path / "units" / "l.timer")
|
|
72
|
+
monkeypatch.setattr(service, "LOCAL_BIN", tmp_path / "local-bin")
|
|
73
|
+
monkeypatch.setattr(service, "_systemctl", lambda *a: pytest.fail("must not run"))
|
|
74
|
+
|
|
75
|
+
assert not service.install_service()
|
|
76
|
+
assert not service.install_learn_timer()
|
|
77
|
+
assert service.install_symlinks() == []
|
|
78
|
+
assert not (tmp_path / "units").exists() and not (tmp_path / "local-bin").exists()
|
|
79
|
+
err = capsys.readouterr().err
|
|
80
|
+
assert "uv tool install 'python-voiceio[desktop]'" in err and "voiceio setup" in err
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def test_noninteractive_setup_refuses_from_uvx(monkeypatch, uv_cache, capsys):
|
|
84
|
+
from voiceio.setup.noninteractive import run_setup_noninteractive
|
|
85
|
+
monkeypatch.setattr(sys, "prefix", str(uv_cache))
|
|
86
|
+
assert run_setup_noninteractive({}) == 3
|
|
87
|
+
out = capsys.readouterr().out
|
|
88
|
+
assert "step=install status=error" in out and "uv tool install" in out
|
|
89
|
+
from voiceio.config import CONFIG_PATH
|
|
90
|
+
assert not CONFIG_PATH.exists()
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def test_wizard_refuses_from_uvx(monkeypatch, uv_cache, capsys):
|
|
94
|
+
from voiceio.setup import steps
|
|
95
|
+
monkeypatch.setattr(sys, "prefix", str(uv_cache))
|
|
96
|
+
monkeypatch.setattr(steps, "_welcome", lambda: pytest.fail("must stop first"))
|
|
97
|
+
with pytest.raises(SystemExit) as e:
|
|
98
|
+
steps.run_wizard()
|
|
99
|
+
assert e.value.code == 3
|
|
100
|
+
assert "uv tool install 'python-voiceio[desktop]'" in capsys.readouterr().out
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@pytest.fixture
|
|
104
|
+
def written(monkeypatch, tmp_path):
|
|
105
|
+
"""Point the service unit, learn unit, IBus launcher and links at tmp."""
|
|
106
|
+
from voiceio.ibus import install as ibus_install
|
|
107
|
+
paths = {
|
|
108
|
+
"unit": tmp_path / "voiceio.service",
|
|
109
|
+
"learn": tmp_path / "voiceio-learn.service",
|
|
110
|
+
"launcher": tmp_path / "voiceio-ibus-engine",
|
|
111
|
+
"bin": tmp_path / "local-bin",
|
|
112
|
+
}
|
|
113
|
+
paths["bin"].mkdir()
|
|
114
|
+
monkeypatch.setattr(service, "SERVICE_PATH", paths["unit"])
|
|
115
|
+
monkeypatch.setattr(service, "LEARN_SERVICE_PATH", paths["learn"])
|
|
116
|
+
monkeypatch.setattr(service, "LOCAL_BIN", paths["bin"])
|
|
117
|
+
monkeypatch.setattr(ibus_install, "LAUNCHER_PATH", paths["launcher"])
|
|
118
|
+
return paths
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_doctor_flags_units_and_launcher_in_uv_cache(monkeypatch, tmp_path, uv_cache, written):
|
|
122
|
+
good = tmp_path / "tools" / "bin" / "voiceio"
|
|
123
|
+
good.parent.mkdir(parents=True)
|
|
124
|
+
good.write_text("#!/bin/sh\n")
|
|
125
|
+
cached = uv_cache / "bin" / "voiceio"
|
|
126
|
+
written["unit"].write_text(service._service_unit(str(cached)))
|
|
127
|
+
written["learn"].write_text(f"[Service]\nExecStart={good} learn maintain\n")
|
|
128
|
+
written["launcher"].write_text(
|
|
129
|
+
f'VOICEIO_PKG_ROOT="{uv_cache}/lib/python3.14/site-packages"\n'
|
|
130
|
+
'SYSTEM_PY="/usr/bin/python3"\n'
|
|
131
|
+
f'INSTALL_PY="{uv_cache}/bin/python"\n')
|
|
132
|
+
(written["bin"] / "voiceio").symlink_to(cached)
|
|
133
|
+
|
|
134
|
+
stale = install_env.stale_install_paths()
|
|
135
|
+
flagged = {path for _, path, _ in stale}
|
|
136
|
+
assert str(cached) in flagged
|
|
137
|
+
assert f"{uv_cache}/lib/python3.14/site-packages" in flagged
|
|
138
|
+
assert f"{uv_cache}/bin/python" in flagged
|
|
139
|
+
assert str(good) not in flagged and "/usr/bin/python3" not in flagged
|
|
140
|
+
assert any(w.startswith("command link") for w, _, _ in stale)
|
|
141
|
+
assert {p for _, _, p in stale} <= {"in uv's cache", "in uv's cache, already deleted"}
|
|
142
|
+
|
|
143
|
+
monkeypatch.setattr(sys, "prefix", str(tmp_path / "tools"))
|
|
144
|
+
report = install_env.stale_paths_report(stale)
|
|
145
|
+
assert "uv tool install 'python-voiceio[desktop]'" in report and "voiceio setup" in report
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_doctor_flags_a_unit_whose_binary_is_gone(tmp_path, written, monkeypatch):
|
|
149
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "cache"))
|
|
150
|
+
gone = tmp_path / "old-venv" / "bin" / "voiceio"
|
|
151
|
+
written["unit"].write_text(service._service_unit(str(gone)))
|
|
152
|
+
assert install_env.stale_install_paths() == [
|
|
153
|
+
(f"autostart service {written['unit']}", str(gone), "no longer exists")]
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_doctor_is_quiet_for_a_durable_install(tmp_path, written, monkeypatch):
|
|
157
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(tmp_path / "cache"))
|
|
158
|
+
good = tmp_path / "venv" / "bin" / "voiceio"
|
|
159
|
+
good.parent.mkdir(parents=True)
|
|
160
|
+
good.write_text("#!/bin/sh\n")
|
|
161
|
+
written["unit"].write_text(service._service_unit(str(good)))
|
|
162
|
+
written["learn"].write_text("[Service]\nExecStart=voiceio learn maintain\n") # PATH lookup
|
|
163
|
+
(written["bin"] / "voiceio").symlink_to(good)
|
|
164
|
+
assert install_env.stale_install_paths() == []
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def test_doctor_cli_exits_nonzero_on_stale_paths(monkeypatch, capsys):
|
|
168
|
+
import argparse
|
|
169
|
+
|
|
170
|
+
from voiceio.cli import doctor
|
|
171
|
+
from voiceio import health, platform as plat, config
|
|
172
|
+
monkeypatch.setattr(install_env, "stale_install_paths",
|
|
173
|
+
lambda: [("autostart service x", "/gone/voiceio", "no longer exists")])
|
|
174
|
+
monkeypatch.setattr(install_env, "running_ephemeral", lambda: False)
|
|
175
|
+
rep = health.HealthReport(platform=plat.detect())
|
|
176
|
+
monkeypatch.setattr(health, "check_health", lambda: rep)
|
|
177
|
+
monkeypatch.setattr(health, "format_report", lambda r: "")
|
|
178
|
+
monkeypatch.setattr(health, "usage_findings", lambda: [])
|
|
179
|
+
monkeypatch.setattr(plat, "check_system_deps", lambda: [])
|
|
180
|
+
monkeypatch.setattr(config, "check_permissions", lambda: [])
|
|
181
|
+
monkeypatch.setattr(doctor, "_offer_report", lambda *a: False)
|
|
182
|
+
monkeypatch.setattr(type(rep), "all_ok", property(lambda self: True))
|
|
183
|
+
args = argparse.Namespace(live=False, fix=False, report=False)
|
|
184
|
+
with pytest.raises(SystemExit) as e:
|
|
185
|
+
doctor._cmd_doctor(args)
|
|
186
|
+
assert e.value.code == 1
|
|
187
|
+
out = capsys.readouterr().out
|
|
188
|
+
assert "/gone/voiceio (no longer exists)" in out and "uv tool install" in out
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
from unittest.mock import patch
|
|
5
5
|
|
|
6
6
|
import os
|
|
7
|
+
import sys
|
|
7
8
|
|
|
8
9
|
import pytest
|
|
9
10
|
|
|
@@ -108,6 +109,7 @@ def test_dump_toml_escapes_quotes():
|
|
|
108
109
|
("apt", "sudo apt install build-essential python3-dev portaudio19-dev ibus gir1.2-ibus-1.0 python3-gi"),
|
|
109
110
|
("dnf", "sudo dnf install gcc gcc-c++ make python3-devel portaudio-devel ibus ibus-libs python3-gobject"),
|
|
110
111
|
("pacman", "sudo pacman -S base-devel portaudio ibus python-gobject"),
|
|
112
|
+
("emerge", "sudo emerge --ask sys-devel/gcc media-libs/portaudio app-i18n/ibus dev-python/pygobject"),
|
|
111
113
|
])
|
|
112
114
|
def test_system_deps_install_cmd_per_distro(mgr, expected):
|
|
113
115
|
with patch("voiceio.platform._detect_pkg_manager", return_value=mgr):
|
|
@@ -129,6 +131,72 @@ def test_check_system_deps_reports_missing():
|
|
|
129
131
|
assert plat.check_system_deps() == ["portaudio", "ibus"]
|
|
130
132
|
|
|
131
133
|
|
|
134
|
+
def test_gentoo_hints_use_atoms():
|
|
135
|
+
with patch("voiceio.platform._detect_pkg_manager", return_value="emerge"):
|
|
136
|
+
assert plat.pkg_install("gir1.2-ibus-1.0", "python3-gi") == \
|
|
137
|
+
"sudo emerge --ask app-i18n/ibus dev-python/pygobject"
|
|
138
|
+
assert plat.pkg_install("xdotool", "xclip") == "sudo emerge --ask x11-misc/xdotool x11-misc/xclip"
|
|
139
|
+
assert plat.pkg_install("wtype") == "sudo emerge --ask gui-apps/wtype"
|
|
140
|
+
assert plat.pkg_install("ydotool") == "sudo emerge --ask ydotool" # emerge resolves it
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def test_gentoo_is_detected_by_emerge(monkeypatch):
|
|
144
|
+
plat._detect_pkg_manager.cache_clear()
|
|
145
|
+
monkeypatch.setattr(plat, "is_nixos", lambda: False)
|
|
146
|
+
monkeypatch.setattr(plat.shutil, "which", lambda b: "/usr/bin/emerge" if b == "emerge" else None)
|
|
147
|
+
try:
|
|
148
|
+
assert plat._detect_pkg_manager() == "emerge"
|
|
149
|
+
finally:
|
|
150
|
+
plat._detect_pkg_manager.cache_clear()
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_missing_sounddevice_is_not_missing_portaudio(monkeypatch):
|
|
154
|
+
"""`uvx python-voiceio` (no [desktop]) has no sounddevice: that is the
|
|
155
|
+
extra, not the system library, when the library is installed."""
|
|
156
|
+
import builtins
|
|
157
|
+
real_import = builtins.__import__
|
|
158
|
+
|
|
159
|
+
def no_sounddevice(name, *a, **k):
|
|
160
|
+
if name == "sounddevice":
|
|
161
|
+
raise ImportError("No module named 'sounddevice'")
|
|
162
|
+
return real_import(name, *a, **k)
|
|
163
|
+
monkeypatch.setattr(builtins, "__import__", no_sounddevice)
|
|
164
|
+
monkeypatch.delitem(sys.modules, "sounddevice", raising=False)
|
|
165
|
+
|
|
166
|
+
monkeypatch.setattr(plat, "_portaudio_lib_present", lambda: True)
|
|
167
|
+
assert plat._probe_portaudio()
|
|
168
|
+
problem = plat.audio_problem()
|
|
169
|
+
assert "sounddevice is not installed" in problem and "[desktop]" in problem
|
|
170
|
+
assert "PortAudio" not in problem
|
|
171
|
+
monkeypatch.setattr(plat, "_portaudio_lib_present", lambda: False)
|
|
172
|
+
assert not plat._probe_portaudio() # both missing: still list the system dep
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_portaudio_library_missing_is_a_system_dep(monkeypatch):
|
|
176
|
+
import builtins
|
|
177
|
+
real_import = builtins.__import__
|
|
178
|
+
|
|
179
|
+
def no_lib(name, *a, **k):
|
|
180
|
+
if name == "sounddevice":
|
|
181
|
+
raise OSError("PortAudio library not found")
|
|
182
|
+
return real_import(name, *a, **k)
|
|
183
|
+
monkeypatch.setattr(builtins, "__import__", no_lib)
|
|
184
|
+
monkeypatch.delitem(sys.modules, "sounddevice", raising=False)
|
|
185
|
+
monkeypatch.setattr(plat, "_detect_pkg_manager", lambda: "emerge")
|
|
186
|
+
assert not plat._probe_portaudio()
|
|
187
|
+
assert plat.audio_problem() == ("PortAudio library not found — install: "
|
|
188
|
+
"sudo emerge --ask media-libs/portaudio")
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def test_desktop_hint_under_uvx_names_the_extra(monkeypatch, tmp_path):
|
|
192
|
+
cache = tmp_path / "uv"
|
|
193
|
+
(cache / "archive-v0" / "h").mkdir(parents=True)
|
|
194
|
+
monkeypatch.setenv("UV_CACHE_DIR", str(cache))
|
|
195
|
+
monkeypatch.setattr(sys, "prefix", str(cache / "archive-v0" / "h"))
|
|
196
|
+
hint = plat.desktop_dep_hint("sounddevice")
|
|
197
|
+
assert "uvx 'python-voiceio[desktop]'" in hint and "uv tool install" in hint
|
|
198
|
+
|
|
199
|
+
|
|
132
200
|
def test_check_system_deps_empty_on_non_linux():
|
|
133
201
|
with patch("voiceio.platform._detect_os", return_value="darwin"):
|
|
134
202
|
assert plat.check_system_deps() == []
|
|
@@ -321,6 +389,14 @@ def test_privileged_argv_runs_shell_scripts_with_inner_sudo_under_pkexec(monkeyp
|
|
|
321
389
|
assert plat.privileged_argv(script) == ["pkexec", *script]
|
|
322
390
|
|
|
323
391
|
|
|
392
|
+
def test_privileged_argv_drops_emerge_ask_without_a_terminal(monkeypatch):
|
|
393
|
+
_no_terminal(monkeypatch)
|
|
394
|
+
assert plat.privileged_argv(["sudo", "emerge", "--ask", "media-libs/portaudio"]) == [
|
|
395
|
+
"pkexec", "emerge", "media-libs/portaudio"]
|
|
396
|
+
monkeypatch.setattr(plat, "_has_tty", lambda: True)
|
|
397
|
+
assert plat.privileged_argv(["sudo", "emerge", "--ask", "x"]) == ["sudo", "emerge", "--ask", "x"]
|
|
398
|
+
|
|
399
|
+
|
|
324
400
|
def test_privileged_argv_prefers_cached_sudo(monkeypatch):
|
|
325
401
|
_no_terminal(monkeypatch, sudo_cached=True)
|
|
326
402
|
assert plat.privileged_argv(["sudo", "apt", "install", "x"]) == [
|
|
@@ -385,3 +461,14 @@ def test_doctor_privileged_fix_without_terminal_prints_command(monkeypatch, caps
|
|
|
385
461
|
assert doctor._run_privileged("Fix x", ["sudo", "udevadm", "trigger"], 5) is False
|
|
386
462
|
assert ran == []
|
|
387
463
|
assert "sudo udevadm trigger" in capsys.readouterr().out
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
def test_wizard_names_the_missing_extra_not_a_missing_mic(capsys):
|
|
467
|
+
from voiceio.setup import steps
|
|
468
|
+
state = steps.SetupState()
|
|
469
|
+
state.checks = {"audio": False, "audio_devices": [], "is_windows": False, "is_mac": False,
|
|
470
|
+
"audio_reason": plat.desktop_dep_hint("sounddevice")}
|
|
471
|
+
with pytest.raises(SystemExit):
|
|
472
|
+
steps._require_mic_and_typer(state)
|
|
473
|
+
out = capsys.readouterr().out
|
|
474
|
+
assert "sounddevice is not installed" in out and "No microphone" not in out
|
|
@@ -226,7 +226,32 @@ def test_runtime_and_whisper_detection():
|
|
|
226
226
|
assert not catalog.is_whisper(catalog.PARAKEET)
|
|
227
227
|
m = catalog.info(catalog.PARAKEET)
|
|
228
228
|
assert m.url.startswith("https://github.com/k2-fsa/sherpa-onnx/releases/")
|
|
229
|
-
assert len(
|
|
229
|
+
assert m.sha256s and all(len(h) == 64 for h in m.sha256s) and "huggingface" not in m.url
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def test_every_downloaded_model_pins_valid_sha256s():
|
|
233
|
+
for m in catalog.CATALOG:
|
|
234
|
+
if m.url:
|
|
235
|
+
assert m.sha256s, m.name
|
|
236
|
+
assert all(len(h) == 64 and int(h, 16) >= 0 for h in m.sha256s), m.name
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def test_parakeet_pins_both_the_reuploaded_and_the_old_archive():
|
|
240
|
+
# Hugo0/voiceio#9: sherpa-onnx re-uploaded both archives on 2026-11-07.
|
|
241
|
+
v3 = catalog.info(catalog.PARAKEET_V3).sha256s
|
|
242
|
+
assert "1495e91b59d7fc53ddca91f3431758ec99f8fa253fdb0e1e851be0f72b14b0f9" in v3
|
|
243
|
+
assert "5793d0fd397c5778d2cf2126994d58e9d56b1be7c04d13c7a15bb1b4eafb16bf" in v3
|
|
244
|
+
v2 = catalog.info(catalog.PARAKEET).sha256s
|
|
245
|
+
assert "6fc4426b54aa549a0019b8a75b8dea59164e71790a37ac56a045ad57f915f714" in v2
|
|
246
|
+
assert "157c157bc51155e03e37d2466522a3a737dd9c72bb25f36eb18912964161e1ad" in v2
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def test_pins_accepts_a_string_or_a_tuple():
|
|
250
|
+
assert catalog.pins("") == ()
|
|
251
|
+
assert catalog.pins("AB") == ("ab",)
|
|
252
|
+
assert catalog.pins(("a", "b")) == ("a", "b")
|
|
253
|
+
assert catalog.ModelInfo("x", "sherpa-onnx", "1", "x", BiasMode.UNBOUNDED,
|
|
254
|
+
sha256="cd").sha256s == ("cd",)
|
|
230
255
|
|
|
231
256
|
|
|
232
257
|
def test_catalog_model_is_fetched_on_first_use(fake, monkeypatch, tmp_path):
|
|
@@ -271,10 +296,11 @@ def _serve(monkeypatch, body: bytes):
|
|
|
271
296
|
monkeypatch.setattr("urllib.request.urlopen", lambda req, timeout=0: Resp(body))
|
|
272
297
|
|
|
273
298
|
|
|
274
|
-
def _entry(monkeypatch, body: bytes):
|
|
299
|
+
def _entry(monkeypatch, body: bytes, sha256=None):
|
|
275
300
|
m = catalog.ModelInfo("pk-test", "sherpa-onnx", "1", "x", BiasMode.UNBOUNDED,
|
|
276
301
|
url="https://github.com/x.tar.bz2",
|
|
277
|
-
sha256=hashlib.sha256(body).hexdigest(),
|
|
302
|
+
sha256=hashlib.sha256(body).hexdigest() if sha256 is None else sha256,
|
|
303
|
+
size_mb=1)
|
|
278
304
|
monkeypatch.setattr(fetch, "info", lambda name: m if name == "pk-test" else None)
|
|
279
305
|
|
|
280
306
|
|
|
@@ -377,3 +403,33 @@ def test_wizard_offers_parakeet_first_only_where_it_can_bias(monkeypatch):
|
|
|
377
403
|
assert choices[0][0] == catalog.PARAKEET and speech.default_choice(choices) == 0
|
|
378
404
|
assert not any("recommended" in c[2] for c in choices[1:])
|
|
379
405
|
assert speech.model_choices("es") is speech.MODELS
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
def test_download_accepts_any_pinned_sha256(monkeypatch, tmp_path):
|
|
409
|
+
monkeypatch.setattr(config, "MODELS_DIR", tmp_path)
|
|
410
|
+
body = _tarball()
|
|
411
|
+
_entry(monkeypatch, body, sha256=("0" * 64, hashlib.sha256(body).hexdigest()))
|
|
412
|
+
_serve(monkeypatch, body)
|
|
413
|
+
assert fetch.download("pk-test") == tmp_path / "pk-test"
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def test_checksum_mismatch_names_every_pin_and_the_issue_tracker(monkeypatch, tmp_path):
|
|
417
|
+
monkeypatch.setattr(config, "MODELS_DIR", tmp_path)
|
|
418
|
+
body = _tarball()
|
|
419
|
+
_entry(monkeypatch, body, sha256=("a" * 64, "b" * 64))
|
|
420
|
+
_serve(monkeypatch, body)
|
|
421
|
+
with pytest.raises(OSError) as e:
|
|
422
|
+
fetch.download("pk-test")
|
|
423
|
+
msg = str(e.value)
|
|
424
|
+
assert "checksum mismatch" in msg and "download again" in msg
|
|
425
|
+
assert "aaaaaaaaaaaa… or bbbbbbbbbbbb…" in msg
|
|
426
|
+
assert "re-uploaded" in msg and "https://github.com/Hugo0/voiceio/issues" in msg
|
|
427
|
+
assert sorted(p.name for p in tmp_path.iterdir()) == [] # nothing left behind
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def test_download_without_a_pin_refuses_before_fetching(monkeypatch, tmp_path):
|
|
431
|
+
monkeypatch.setattr(config, "MODELS_DIR", tmp_path)
|
|
432
|
+
_entry(monkeypatch, b"", sha256=())
|
|
433
|
+
monkeypatch.setattr("urllib.request.urlopen", lambda *a, **k: pytest.fail("fetched"))
|
|
434
|
+
with pytest.raises(OSError, match="no pinned sha256"):
|
|
435
|
+
fetch.download("pk-test")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.18.0"
|
|
@@ -92,6 +92,15 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
92
92
|
for path, mode, expected in perm_issues:
|
|
93
93
|
print(f" {oct(mode)[2:]:>4} → {oct(expected)[2:]:>4} {path}")
|
|
94
94
|
|
|
95
|
+
# Units and launchers that run voiceio from uv's cache (uvx) or a path
|
|
96
|
+
# that is gone: they work until uv prunes it, then autostart breaks.
|
|
97
|
+
from voiceio import install_env
|
|
98
|
+
stale_paths = install_env.stale_install_paths()
|
|
99
|
+
if stale_paths:
|
|
100
|
+
print(install_env.stale_paths_report(stale_paths))
|
|
101
|
+
elif install_env.running_ephemeral():
|
|
102
|
+
print("\nNote: " + install_env.ephemeral_message())
|
|
103
|
+
|
|
95
104
|
# System-dependency preflight: the #1 install funnel killer.
|
|
96
105
|
from voiceio import platform as plat
|
|
97
106
|
missing_deps = plat.check_system_deps()
|
|
@@ -115,7 +124,7 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
115
124
|
print("Run 'voiceio doctor --fix' to tighten file permissions.")
|
|
116
125
|
from voiceio.hints import hint
|
|
117
126
|
hint("vocab_suggest", "Run 'voiceio vocab suggest' to find names it keeps mishearing")
|
|
118
|
-
healthy = report.all_ok and not perm_issues and not missing_deps
|
|
127
|
+
healthy = report.all_ok and not perm_issues and not missing_deps and not stale_paths
|
|
119
128
|
if args.report or _offer_report(args, healthy and not report.warnings):
|
|
120
129
|
_share_report(args, report, missing_deps, [p for p, _, _ in perm_issues])
|
|
121
130
|
sys.exit(0 if healthy else 1)
|
|
@@ -161,6 +170,9 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
161
170
|
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as e:
|
|
162
171
|
print(f" Failed: {e}")
|
|
163
172
|
|
|
173
|
+
if stale_paths and not install_env.running_ephemeral():
|
|
174
|
+
fixed_any = _rewrite_stale_paths(stale_paths) or fixed_any
|
|
175
|
+
|
|
164
176
|
# CLI symlinks
|
|
165
177
|
if not report.cli_in_path:
|
|
166
178
|
print(" Fixing CLI: creating symlinks in ~/.local/bin/")
|
|
@@ -235,10 +247,40 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
|
|
|
235
247
|
|
|
236
248
|
missing_deps = plat.check_system_deps()
|
|
237
249
|
perm_issues = _config.check_permissions()
|
|
238
|
-
|
|
250
|
+
stale_paths = install_env.stale_install_paths()
|
|
251
|
+
healthy = (report.all_ok and not perm_issues and not missing_deps and not report.warnings
|
|
252
|
+
and not stale_paths)
|
|
239
253
|
if args.report or _offer_report(args, healthy):
|
|
240
254
|
_share_report(args, report, missing_deps, [p for p, _, _ in perm_issues])
|
|
241
|
-
sys.exit(0 if report.all_ok else 1)
|
|
255
|
+
sys.exit(0 if report.all_ok and not stale_paths else 1)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def _rewrite_stale_paths(stale: list[tuple[str, str, str]]) -> bool:
|
|
259
|
+
"""Rewrite each file stale_install_paths() flagged for the running install."""
|
|
260
|
+
from voiceio import service
|
|
261
|
+
whats = " ".join(what for what, _, _ in stale)
|
|
262
|
+
fixed = False
|
|
263
|
+
for label, needed, fix in (
|
|
264
|
+
("autostart service", "autostart service", service.install_service),
|
|
265
|
+
("learning service", "learning service", service.refresh_learn_timer),
|
|
266
|
+
("IBus launcher", "IBus launcher", None),
|
|
267
|
+
("command links", "command link", service.install_symlinks),
|
|
268
|
+
):
|
|
269
|
+
if needed not in whats:
|
|
270
|
+
continue
|
|
271
|
+
print(f" Fixing {label}: pointing it at {service._find_voiceio_bin()}")
|
|
272
|
+
try:
|
|
273
|
+
if fix is None:
|
|
274
|
+
from voiceio.ibus import install
|
|
275
|
+
ok = install.install_component()
|
|
276
|
+
else:
|
|
277
|
+
ok = bool(fix())
|
|
278
|
+
except Exception as e: # noqa: BLE001 — report, keep fixing the rest
|
|
279
|
+
print(f" Failed: {e}")
|
|
280
|
+
continue
|
|
281
|
+
print(" Done." if ok else " Failed: run 'voiceio setup' again.")
|
|
282
|
+
fixed = fixed or ok
|
|
283
|
+
return fixed
|
|
242
284
|
|
|
243
285
|
|
|
244
286
|
def _offer_report(args: argparse.Namespace, healthy: bool) -> bool:
|
|
@@ -35,10 +35,25 @@ class ModelInfo:
|
|
|
35
35
|
experimental: bool = False
|
|
36
36
|
# Models voiceio downloads itself (sherpa-onnx): a release tarball, its
|
|
37
37
|
# sha256, and its size. faster-whisper models come from the HF cache.
|
|
38
|
+
# `sha256` may be a tuple of known-good digests: upstream sometimes
|
|
39
|
+
# re-uploads an archive, and old caches and mirrors still hold the old one.
|
|
40
|
+
# Every digest is pinned by hand; never trust a live one from GitHub.
|
|
38
41
|
url: str = ""
|
|
39
|
-
sha256: str = ""
|
|
42
|
+
sha256: str | tuple[str, ...] = ""
|
|
40
43
|
size_mb: int = 0
|
|
41
44
|
|
|
45
|
+
@property
|
|
46
|
+
def sha256s(self) -> tuple[str, ...]:
|
|
47
|
+
"""Every known-good sha256 of the archive (empty when there is none)."""
|
|
48
|
+
return pins(self.sha256)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def pins(sha256: str | tuple[str, ...]) -> tuple[str, ...]:
|
|
52
|
+
"""A pin (one digest or a tuple of them) as a tuple, lower-cased."""
|
|
53
|
+
if isinstance(sha256, str):
|
|
54
|
+
sha256 = (sha256,) if sha256 else ()
|
|
55
|
+
return tuple(h.lower() for h in sha256)
|
|
56
|
+
|
|
42
57
|
|
|
43
58
|
_SHERPA_RELEASES = "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models"
|
|
44
59
|
|
|
@@ -51,14 +66,18 @@ CATALOG: tuple[ModelInfo, ...] = (
|
|
|
51
66
|
notes="default when sherpa-onnx has the NeMo TDT beam-search fix: text ~0.7s after you stop "
|
|
52
67
|
"talking vs ~4.4s with Whisper, every proper noun of your vocabulary as a hotword",
|
|
53
68
|
url=f"{_SHERPA_RELEASES}/sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2",
|
|
54
|
-
|
|
69
|
+
# Re-uploaded upstream 2026-11-07 (Hugo0/voiceio#9); the old one stays valid.
|
|
70
|
+
sha256=("6fc4426b54aa549a0019b8a75b8dea59164e71790a37ac56a045ad57f915f714",
|
|
71
|
+
"157c157bc51155e03e37d2466522a3a737dd9c72bb25f36eb18912964161e1ad"),
|
|
55
72
|
size_mb=482),
|
|
56
73
|
ModelInfo(PARAKEET_V3, "sherpa-onnx", "600M", "CC-BY-4.0", BiasMode.UNBOUNDED,
|
|
57
74
|
languages=",".join(sorted(PARAKEET_V3_LANGUAGES)),
|
|
58
75
|
notes="the default for the other 24 European languages it covers; v2 stays the "
|
|
59
76
|
"English default (trained on English only, lower English WER)",
|
|
60
77
|
url=f"{_SHERPA_RELEASES}/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8.tar.bz2",
|
|
61
|
-
|
|
78
|
+
# Re-uploaded upstream 2026-11-07 (Hugo0/voiceio#9); the old one stays valid.
|
|
79
|
+
sha256=("1495e91b59d7fc53ddca91f3431758ec99f8fa253fdb0e1e851be0f72b14b0f9",
|
|
80
|
+
"5793d0fd397c5778d2cf2126994d58e9d56b1be7c04d13c7a15bb1b4eafb16bf"),
|
|
62
81
|
size_mb=487),
|
|
63
82
|
ModelInfo("small", "faster-whisper", "244M", "MIT", BiasMode.HOTWORDS | BiasMode.PROMPT,
|
|
64
83
|
notes="~5x realtime on a laptop CPU; hotwords cap ~35 terms; "
|
|
@@ -16,7 +16,7 @@ import urllib.request
|
|
|
16
16
|
from collections.abc import Callable
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
|
|
19
|
-
from voiceio.core.decoders.catalog import ModelInfo, info
|
|
19
|
+
from voiceio.core.decoders.catalog import ModelInfo, info, pins
|
|
20
20
|
|
|
21
21
|
log = logging.getLogger(__name__)
|
|
22
22
|
|
|
@@ -72,15 +72,22 @@ def download(name: str, *, progress: Callable[[int, int], None] | None = None) -
|
|
|
72
72
|
what="encoder/decoder/joiner/tokens.txt", progress=progress)
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
ISSUES = "https://github.com/Hugo0/voiceio/issues"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def download_archive(name: str, url: str, sha256: str | tuple[str, ...], size_mb: int,
|
|
76
79
|
complete: Callable[[Path], bool], *, what: str,
|
|
77
80
|
progress: Callable[[int, int], None] | None = None) -> Path:
|
|
78
81
|
"""Fetch, verify and unpack a sherpa-onnx release tarball as
|
|
79
|
-
`models_dir()/name`. `
|
|
80
|
-
|
|
82
|
+
`models_dir()/name`. `sha256` is one known-good digest or a tuple of
|
|
83
|
+
them; the archive must match one. `complete` says whether a directory
|
|
84
|
+
holds the whole model (`what` names its files for the error)."""
|
|
81
85
|
dest = model_path(name)
|
|
82
86
|
if complete(dest):
|
|
83
87
|
return dest
|
|
88
|
+
known = pins(sha256)
|
|
89
|
+
if not known:
|
|
90
|
+
raise OSError(f"{name}: no pinned sha256 — not downloading")
|
|
84
91
|
root = models_dir()
|
|
85
92
|
root.mkdir(parents=True, exist_ok=True)
|
|
86
93
|
part = root / f".{name}.{os.getpid()}.part"
|
|
@@ -98,9 +105,11 @@ def download_archive(name: str, url: str, sha256: str, size_mb: int,
|
|
|
98
105
|
done += len(block)
|
|
99
106
|
if progress is not None:
|
|
100
107
|
progress(done, total)
|
|
101
|
-
if digest.hexdigest()
|
|
108
|
+
if digest.hexdigest() not in known:
|
|
109
|
+
want = " or ".join(f"{h[:12]}…" for h in known)
|
|
102
110
|
raise OSError(f"{name}: checksum mismatch (got {digest.hexdigest()[:12]}…, "
|
|
103
|
-
f"want {
|
|
111
|
+
f"want {want}) — download again; if it keeps failing, upstream "
|
|
112
|
+
f"may have re-uploaded the archive: report it at {ISSUES}")
|
|
104
113
|
_unpack(part, staging)
|
|
105
114
|
if not complete(staging):
|
|
106
115
|
raise OSError(f"{name}: the archive has no {what}")
|