python-voiceio 1.18.15__tar.gz → 1.18.18__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.
Files changed (254) hide show
  1. {python_voiceio-1.18.15/python_voiceio.egg-info → python_voiceio-1.18.18}/PKG-INFO +1 -1
  2. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/pyproject.toml +1 -1
  3. {python_voiceio-1.18.15 → python_voiceio-1.18.18/python_voiceio.egg-info}/PKG-INFO +1 -1
  4. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/python_voiceio.egg-info/SOURCES.txt +2 -0
  5. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_hotkey_modes.py +10 -3
  6. python_voiceio-1.18.18/tests/test_input_latency.py +212 -0
  7. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_mic_test.py +35 -0
  8. python_voiceio-1.18.18/tests/test_setup_sherpa_install.py +181 -0
  9. python_voiceio-1.18.18/voiceio/__init__.py +1 -0
  10. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/app.py +111 -15
  11. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/config.py +16 -0
  12. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/fetch.py +60 -15
  13. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/speech.py +93 -8
  14. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/steps.py +5 -1
  15. python_voiceio-1.18.15/voiceio/__init__.py +0 -1
  16. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/LICENSE +0 -0
  17. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/README.md +0 -0
  18. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/python_voiceio.egg-info/dependency_links.txt +0 -0
  19. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/python_voiceio.egg-info/entry_points.txt +0 -0
  20. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/python_voiceio.egg-info/requires.txt +0 -0
  21. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/python_voiceio.egg-info/top_level.txt +0 -0
  22. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/setup.cfg +0 -0
  23. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_announce.py +0 -0
  24. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_app_wiring.py +0 -0
  25. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_audio_devices.py +0 -0
  26. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_audio_quality.py +0 -0
  27. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_audio_source.py +0 -0
  28. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_backend_probes.py +0 -0
  29. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_cancel.py +0 -0
  30. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_cli.py +0 -0
  31. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_clipboard_read.py +0 -0
  32. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_clipboard_typer.py +0 -0
  33. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_commands.py +0 -0
  34. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_concurrency_lockdown.py +0 -0
  35. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_config.py +0 -0
  36. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_context_terms.py +0 -0
  37. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_corrections.py +0 -0
  38. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_cuda_setup_hint.py +0 -0
  39. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_dead_mic.py +0 -0
  40. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_decoders.py +0 -0
  41. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_engine.py +0 -0
  42. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_errorlog.py +0 -0
  43. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_evdev_uaccess.py +0 -0
  44. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_evdev_x11_optional.py +0 -0
  45. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_fallback.py +0 -0
  46. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_fcitx_bridge.py +0 -0
  47. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_feedback_stream.py +0 -0
  48. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_focus.py +0 -0
  49. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_gpu_fallback.py +0 -0
  50. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_health.py +0 -0
  51. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_hints.py +0 -0
  52. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_history.py +0 -0
  53. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_engine_limits.py +0 -0
  54. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_engine_listener.py +0 -0
  55. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_pending.py +0 -0
  56. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_pids.py +0 -0
  57. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_ping.py +0 -0
  58. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_session.py +0 -0
  59. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_textlimit.py +0 -0
  60. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_ibus_typer.py +0 -0
  61. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_idle_audio.py +0 -0
  62. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_install_env.py +0 -0
  63. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_clean.py +0 -0
  64. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_import.py +0 -0
  65. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_language.py +0 -0
  66. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_metrics.py +0 -0
  67. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_pipeline.py +0 -0
  68. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_quiet.py +0 -0
  69. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_resume.py +0 -0
  70. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_review.py +0 -0
  71. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_summary.py +0 -0
  72. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_learn_targets.py +0 -0
  73. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_llm.py +0 -0
  74. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_llm_api.py +0 -0
  75. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_mic_gain.py +0 -0
  76. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_modifier_guard.py +0 -0
  77. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_numbers.py +0 -0
  78. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_paste_last.py +0 -0
  79. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_pipeline.py +0 -0
  80. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_platform.py +0 -0
  81. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_postcorrect.py +0 -0
  82. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_postprocess.py +0 -0
  83. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_prebuffer.py +0 -0
  84. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_presence.py +0 -0
  85. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_prompt.py +0 -0
  86. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_quiet_audio.py +0 -0
  87. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_recorder_integration.py +0 -0
  88. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_replies.py +0 -0
  89. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_report.py +0 -0
  90. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_retention.py +0 -0
  91. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_robustness.py +0 -0
  92. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_security_hardening.py +0 -0
  93. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_server.py +0 -0
  94. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_service.py +0 -0
  95. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_setup.py +0 -0
  96. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_sherpa.py +0 -0
  97. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_spool.py +0 -0
  98. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_streaming.py +0 -0
  99. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_suggest.py +0 -0
  100. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_telemetry.py +0 -0
  101. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_tokens.py +0 -0
  102. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_transcriber.py +0 -0
  103. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_tray.py +0 -0
  104. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_tts.py +0 -0
  105. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_tts_socket.py +0 -0
  106. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_typer_manager.py +0 -0
  107. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_vad.py +0 -0
  108. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_vocabulary.py +0 -0
  109. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_wordfreq.py +0 -0
  110. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/tests/test_worker_decode.py +0 -0
  111. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/__main__.py +0 -0
  112. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/announce.py +0 -0
  113. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/audio_devices.py +0 -0
  114. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/audio_source.py +0 -0
  115. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/backends.py +0 -0
  116. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/__init__.py +0 -0
  117. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/configcmd.py +0 -0
  118. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/corrections.py +0 -0
  119. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/doctor.py +0 -0
  120. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/history.py +0 -0
  121. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/learn.py +0 -0
  122. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/models.py +0 -0
  123. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/replies.py +0 -0
  124. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/servicecmd.py +0 -0
  125. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/uninstall.py +0 -0
  126. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/cli/vocab.py +0 -0
  127. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/clipboard_read.py +0 -0
  128. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/commands.py +0 -0
  129. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/consent.py +0 -0
  130. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/context_terms.py +0 -0
  131. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/__init__.py +0 -0
  132. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/bias.py +0 -0
  133. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/__init__.py +0 -0
  134. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/base.py +0 -0
  135. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/catalog.py +0 -0
  136. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
  137. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
  138. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/lanes.py +0 -0
  139. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/sherpa.py +0 -0
  140. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/decoders/whispercpp.py +0 -0
  141. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/engine.py +0 -0
  142. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/core/pipeline.py +0 -0
  143. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/corrections.py +0 -0
  144. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/data/60-voiceio-uaccess.rules +0 -0
  145. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/data/__init__.py +0 -0
  146. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/demo.py +0 -0
  147. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/display.py +0 -0
  148. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/errorlog.py +0 -0
  149. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/feedback.py +0 -0
  150. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/focus.py +0 -0
  151. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/health.py +0 -0
  152. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hints.py +0 -0
  153. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/history.py +0 -0
  154. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/__init__.py +0 -0
  155. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/base.py +0 -0
  156. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/chain.py +0 -0
  157. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/evdev.py +0 -0
  158. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/pynput_backend.py +0 -0
  159. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/hotkeys/socket_backend.py +0 -0
  160. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/__init__.py +0 -0
  161. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/engine.py +0 -0
  162. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/install.py +0 -0
  163. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/pending.py +0 -0
  164. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/session.py +0 -0
  165. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ibus/textlimit.py +0 -0
  166. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/idle_audio.py +0 -0
  167. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/install_env.py +0 -0
  168. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/__init__.py +0 -0
  169. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/augment.py +0 -0
  170. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/clean.py +0 -0
  171. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/evaluate.py +0 -0
  172. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/importer.py +0 -0
  173. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/lastrun.py +0 -0
  174. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/metrics.py +0 -0
  175. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/quiet.py +0 -0
  176. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/review.py +0 -0
  177. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/store.py +0 -0
  178. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/summary.py +0 -0
  179. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/teacher.py +0 -0
  180. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/learn/train.py +0 -0
  181. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/llm.py +0 -0
  182. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/llm_api.py +0 -0
  183. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/mic_gain.py +0 -0
  184. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/models/__init__.py +0 -0
  185. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/models/silero_vad.onnx +0 -0
  186. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/numbers.py +0 -0
  187. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/pidlock.py +0 -0
  188. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/platform.py +0 -0
  189. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/postcorrect.py +0 -0
  190. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/postprocess.py +0 -0
  191. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/power.py +0 -0
  192. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/presence.py +0 -0
  193. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/privacy.py +0 -0
  194. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/prompt.py +0 -0
  195. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/quiet_audio.py +0 -0
  196. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/recorder.py +0 -0
  197. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/replies.py +0 -0
  198. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/report.py +0 -0
  199. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/retention.py +0 -0
  200. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/server/__init__.py +0 -0
  201. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/server/__main__.py +0 -0
  202. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/server/app.py +0 -0
  203. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/server/config.py +0 -0
  204. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/server/runtime.py +0 -0
  205. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/service.py +0 -0
  206. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/__init__.py +0 -0
  207. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/configfile.py +0 -0
  208. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/extras.py +0 -0
  209. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/hotkey.py +0 -0
  210. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/noninteractive.py +0 -0
  211. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/system.py +0 -0
  212. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/setup/ui.py +0 -0
  213. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/sounds/__init__.py +0 -0
  214. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/sounds/alert.wav +0 -0
  215. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/sounds/commit.wav +0 -0
  216. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/sounds/start.wav +0 -0
  217. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/sounds/stop.wav +0 -0
  218. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/spool.py +0 -0
  219. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/streaming.py +0 -0
  220. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/suggest.py +0 -0
  221. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/telemetry.py +0 -0
  222. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tokens.py +0 -0
  223. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tray/__init__.py +0 -0
  224. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tray/_icons.py +0 -0
  225. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tray/_indicator.py +0 -0
  226. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tray/_pystray.py +0 -0
  227. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/__init__.py +0 -0
  228. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/base.py +0 -0
  229. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/chain.py +0 -0
  230. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/edge_engine.py +0 -0
  231. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/espeak.py +0 -0
  232. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/piper_engine.py +0 -0
  233. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/player.py +0 -0
  234. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/tts/supertonic_engine.py +0 -0
  235. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/__init__.py +0 -0
  236. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/base.py +0 -0
  237. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/chain.py +0 -0
  238. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/clipboard.py +0 -0
  239. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/collecting.py +0 -0
  240. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/fcitx_bridge.py +0 -0
  241. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/ibus.py +0 -0
  242. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/manager.py +0 -0
  243. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/modifier_guard.py +0 -0
  244. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/paste.py +0 -0
  245. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/pynput_type.py +0 -0
  246. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/wtype.py +0 -0
  247. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/xdotool.py +0 -0
  248. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/typers/ydotool.py +0 -0
  249. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/ui.py +0 -0
  250. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/vad.py +0 -0
  251. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/vocab_stats.py +0 -0
  252. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/vocabulary.py +0 -0
  253. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/watchdog.py +0 -0
  254. {python_voiceio-1.18.15 → python_voiceio-1.18.18}/voiceio/wordfreq.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-voiceio
3
- Version: 1.18.15
3
+ Version: 1.18.18
4
4
  Summary: Voice dictation for Linux. Speak → text, locally, instantly.
5
5
  Author: Hugo Montenegro
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-voiceio"
7
- version = "1.18.15"
7
+ version = "1.18.18"
8
8
  description = "Voice dictation for Linux. Speak → text, locally, instantly."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-voiceio
3
- Version: 1.18.15
3
+ Version: 1.18.18
4
4
  Summary: Voice dictation for Linux. Speak → text, locally, instantly.
5
5
  Author: Hugo Montenegro
6
6
  License-Expression: MIT
@@ -47,6 +47,7 @@ tests/test_ibus_session.py
47
47
  tests/test_ibus_textlimit.py
48
48
  tests/test_ibus_typer.py
49
49
  tests/test_idle_audio.py
50
+ tests/test_input_latency.py
50
51
  tests/test_install_env.py
51
52
  tests/test_learn_clean.py
52
53
  tests/test_learn_import.py
@@ -82,6 +83,7 @@ tests/test_security_hardening.py
82
83
  tests/test_server.py
83
84
  tests/test_service.py
84
85
  tests/test_setup.py
86
+ tests/test_setup_sherpa_install.py
85
87
  tests/test_sherpa.py
86
88
  tests/test_spool.py
87
89
  tests/test_streaming.py
@@ -114,13 +114,20 @@ def test_release_tail_keeps_recording_briefly():
114
114
  assert _wait_stopped(vio)
115
115
 
116
116
 
117
- def test_press_during_tail_stops_once():
117
+ def test_press_during_tail_keeps_recording():
118
+ """Pressed again before the tail ran out: not done yet. The same
119
+ recording goes on, and the new press is push-to-talk again."""
118
120
  vio = _make_app("hold", tail_ms=100)
119
121
  vio.on_hotkey_press()
120
122
  vio.on_hotkey_release()
121
123
  _after_debounce(vio)
122
- vio.on_hotkey_press() # stops now
123
- time.sleep(0.2) # tail timer fires: stale
124
+ vio.on_hotkey_press() # withdraws the stop
125
+ time.sleep(0.2) # tail timer would have fired
126
+ assert vio.stops == [] and vio._state == _State.RECORDING
127
+ assert vio._recording == 1
128
+ vio.on_hotkey_release()
129
+ assert _wait_stopped(vio)
130
+ time.sleep(0.15)
124
131
  assert vio.stops == [1]
125
132
 
126
133
 
@@ -0,0 +1,212 @@
1
+ """audio.input_latency_ms: stopping waits out the audio still on its way."""
2
+ from __future__ import annotations
3
+
4
+ import time
5
+ from unittest.mock import MagicMock, patch
6
+
7
+ import pytest
8
+ from test_hotkey_modes import _after_debounce, _make_app, _wait_stopped
9
+
10
+ from voiceio.app import _State
11
+ from voiceio.config import AudioConfig, load
12
+
13
+
14
+ @pytest.fixture
15
+ def tray():
16
+ with patch("voiceio.app.tray") as t:
17
+ yield t
18
+
19
+
20
+ def _app(mode="toggle", latency_ms=0, tail_ms=0):
21
+ """Hotkey-level app (start/stop stubbed) with the stop feedback observable."""
22
+ vio = _make_app(mode, tail_ms=tail_ms)
23
+ vio.cfg.audio.input_latency_ms = latency_ms
24
+ vio._play_record_cue = MagicMock()
25
+ vio._quiet = MagicMock()
26
+ vio._quiet.stop.side_effect = lambda then=None: then and then()
27
+ vio.recorder = MagicMock()
28
+ vio._typers = MagicMock()
29
+ vio._spool = MagicMock()
30
+ return vio
31
+
32
+
33
+ def _cues(vio):
34
+ return [c.kwargs["start"] for c in vio._play_record_cue.call_args_list]
35
+
36
+
37
+ def _start_then_stop(vio):
38
+ vio.on_hotkey()
39
+ _after_debounce(vio)
40
+ vio.on_hotkey()
41
+
42
+
43
+ def test_toggle_without_latency_stops_at_once(tray):
44
+ vio = _app("toggle", latency_ms=0)
45
+ _start_then_stop(vio)
46
+ assert vio.stops == [1] and vio._pending_stop is None
47
+
48
+
49
+ def test_toggle_with_latency_records_the_tail(tray):
50
+ vio = _app("toggle", latency_ms=120)
51
+ vio.on_hotkey()
52
+ _after_debounce(vio)
53
+ pressed = time.monotonic()
54
+ vio.on_hotkey()
55
+ assert vio.stops == [] and vio._state == _State.RECORDING # still capturing
56
+ # Feedback at the press, not when the tail ends.
57
+ assert _cues(vio) == [False]
58
+ tray.set_recording.assert_called_with(False)
59
+ tray.set_processing.assert_called_with(True)
60
+ assert _wait_stopped(vio)
61
+ assert time.monotonic() - pressed >= 0.11
62
+ assert vio.stops == [1] and vio._pending_stop is None
63
+
64
+
65
+ def test_auto_tap_stop_gets_the_latency_tail(tray):
66
+ vio = _app("auto", latency_ms=90, tail_ms=250)
67
+ vio.on_hotkey_press()
68
+ vio.on_hotkey_release() # a tap: latched
69
+ _after_debounce(vio)
70
+ vio.on_hotkey_press() # the stop tap
71
+ assert vio._pending_stop.timer.interval == pytest.approx(0.09)
72
+ assert _wait_stopped(vio)
73
+
74
+
75
+ @pytest.mark.parametrize("latency_ms,announced", [(0, False), (40, True)])
76
+ def test_hold_tail_is_release_tail_plus_latency(tray, latency_ms, announced):
77
+ vio = _app("hold", latency_ms=latency_ms, tail_ms=60)
78
+ vio.on_hotkey_press()
79
+ vio.on_hotkey_release()
80
+ assert vio._pending_stop.timer.interval == pytest.approx((60 + latency_ms) / 1000)
81
+ # Without latency the stop chime comes with the stop, as before.
82
+ assert _cues(vio) == ([False] if announced else [])
83
+ assert _wait_stopped(vio)
84
+ assert vio.stops == [1]
85
+
86
+
87
+ def test_toggle_press_during_tail_keeps_recording(tray):
88
+ vio = _app("toggle", latency_ms=2000)
89
+ _start_then_stop(vio)
90
+ timer = vio._pending_stop.timer
91
+ _after_debounce(vio) # a press inside the 0.8 s debounce is the same press
92
+ vio.on_hotkey() # "I'm not done"
93
+ assert vio._pending_stop is None and timer.finished.is_set()
94
+ assert vio._state == _State.RECORDING and vio._recording == 1
95
+ assert _cues(vio) == [False, True] # stop chime, then the start chime again
96
+ tray.set_recording.assert_called_with(True)
97
+ tray.set_processing.assert_called_with(False)
98
+ vio.recorder.set_on_auto_stop.assert_called_with(vio._on_auto_stop)
99
+ # The next stop press stops the same recording, after its own tail.
100
+ vio.cfg.audio.input_latency_ms = 50
101
+ _after_debounce(vio)
102
+ vio.on_hotkey()
103
+ assert _wait_stopped(vio)
104
+ assert vio.stops == [1]
105
+
106
+
107
+ def test_hold_press_during_tail_is_push_to_talk_again(tray):
108
+ vio = _app("hold", latency_ms=100, tail_ms=0)
109
+ vio.on_hotkey_press()
110
+ vio.on_hotkey_release()
111
+ _after_debounce(vio)
112
+ vio.on_hotkey_press()
113
+ assert vio._held is not None and vio._held[1] == 1
114
+ time.sleep(0.15)
115
+ assert vio.stops == []
116
+ vio.on_hotkey_release()
117
+ assert _wait_stopped(vio)
118
+ assert vio.stops == [1]
119
+
120
+
121
+ def test_stale_tail_timer_never_stops_a_newer_recording(tray):
122
+ vio = _app("toggle", latency_ms=80)
123
+ _start_then_stop(vio)
124
+ pending = vio._pending_stop
125
+ vio._do_stop() # recording 1 ends some other way
126
+ vio._do_start() # recording 2 within the tail
127
+ time.sleep(0.15)
128
+ assert vio.stops == [1] and vio._state == _State.RECORDING
129
+ vio._stop_due(pending) # fired late: still nothing
130
+ assert vio.stops == [1]
131
+
132
+
133
+ def test_withdrawn_stop_timer_does_nothing(tray):
134
+ vio = _app("toggle", latency_ms=2000)
135
+ _start_then_stop(vio)
136
+ pending = vio._pending_stop
137
+ _after_debounce(vio)
138
+ vio.on_hotkey() # withdrawn
139
+ vio._stop_due(pending) # as if the cancel lost the race
140
+ assert vio.stops == [] and vio._state == _State.RECORDING
141
+
142
+
143
+ def test_cancel_during_tail_cancels_at_once(tray):
144
+ vio = _app("toggle", latency_ms=2000)
145
+ _start_then_stop(vio)
146
+ timer = vio._pending_stop.timer
147
+ vio.cancel()
148
+ assert vio._state == _State.IDLE and vio._pending_stop is None
149
+ assert timer.finished.is_set() # timer cancelled
150
+ vio.recorder.stop.assert_called_once() # audio dropped, no finalize
151
+ assert vio.stops == []
152
+ assert _cues(vio) == [False] # one stop chime, not two
153
+ vio._quiet.stop.assert_called_once()
154
+ tray.set_processing.assert_called_with(False)
155
+
156
+
157
+ def test_auto_stop_during_tail_leaves_it_to_the_tail(tray):
158
+ vio = _app("toggle", latency_ms=100)
159
+ _start_then_stop(vio)
160
+ _after_debounce(vio)
161
+ vio._request_stop() # silence auto-stop meanwhile
162
+ assert vio.stops == []
163
+ assert _wait_stopped(vio)
164
+ assert vio.stops == [1]
165
+
166
+
167
+ def test_auto_stop_without_a_tail_stops_at_once(tray):
168
+ vio = _app("toggle", latency_ms=2000)
169
+ vio.on_hotkey()
170
+ _after_debounce(vio)
171
+ vio._request_stop()
172
+ assert vio.stops == [1]
173
+
174
+
175
+ # ── config ──────────────────────────────────────────────────────────────
176
+
177
+ @pytest.mark.parametrize("given,used", [
178
+ (0, 0), (2500, 2500), (5000, 5000), (-5, 0), (9000, 5000),
179
+ ("2 s", 0), (True, 0), (300.7, 300),
180
+ ])
181
+ def test_input_latency_is_validated(given, used):
182
+ assert AudioConfig(input_latency_ms=given).input_latency_ms == used
183
+
184
+
185
+ def test_input_latency_from_the_config_file(tmp_path):
186
+ path = tmp_path / "config.toml"
187
+ path.write_text("[audio]\ninput_latency_ms = 2000\n")
188
+ assert load(path).audio.input_latency_ms == 2000
189
+ path.write_text("[audio]\ninput_latency_ms = 60000\n")
190
+ assert load(path).audio.input_latency_ms == 5000
191
+ assert load(tmp_path / "missing.toml").audio.input_latency_ms == 0
192
+
193
+
194
+ def test_real_stop_after_the_tail_does_not_chime_twice(tray):
195
+ from test_cancel import _make_app as _full_app
196
+ vio = _full_app(streaming=False)
197
+ vio.cfg.audio.input_latency_ms = 60
198
+ vio._play_record_cue = MagicMock()
199
+ vio._quiet.stop.side_effect = lambda then=None: then and then()
200
+ vio._state, vio._recording = _State.RECORDING, 3
201
+ with patch.object(vio, "_output_thread") as spawn:
202
+ vio.on_hotkey() # stop press: chime now
203
+ assert vio._state == _State.RECORDING
204
+ deadline = time.monotonic() + 2
205
+ while vio._state != _State.IDLE and time.monotonic() < deadline:
206
+ time.sleep(0.005)
207
+ assert vio._state == _State.IDLE
208
+ spawn.assert_called_once() # the tail's audio is decoded
209
+ vio.recorder.stop.assert_called_once()
210
+ assert _cues(vio) == [False]
211
+ vio._quiet.stop.assert_called_once()
212
+ assert vio._stop_announced == 0
@@ -148,3 +148,38 @@ def test_stream_with_no_audio_says_so(run, capsys):
148
148
  ])
149
149
  def test_should_stop(elapsed, heard_at, silent, stop):
150
150
  assert speech._test_should_stop(elapsed, heard_at, silent) is stop
151
+
152
+
153
+ def test_late_voice_suggests_input_latency(run, capsys):
154
+ run(_speech(2.5, 2.0))
155
+ out = capsys.readouterr().out
156
+ assert "voiceio config set audio.input_latency_ms 1900" in out
157
+
158
+
159
+ @pytest.mark.parametrize("start", [0.5, 1.5]) # normal reaction times
160
+ def test_prompt_voice_has_no_latency_hint(run, capsys, start):
161
+ run(_speech(start, 2.0))
162
+ assert "input_latency_ms" not in capsys.readouterr().out
163
+
164
+
165
+ def test_no_sound_has_no_latency_hint(run, capsys):
166
+ run(lambda t: 0.0)
167
+ assert "input_latency_ms" not in capsys.readouterr().out
168
+
169
+
170
+ @pytest.mark.parametrize("onset,ms", [
171
+ (None, None), (0.4, None), (1.5, None), (1.8, None),
172
+ (1.84, 1200), (2.06, 1500), (2.6, 2000), (9.0, 5000),
173
+ ])
174
+ def test_latency_hint_value(onset, ms):
175
+ hint = speech._latency_hint(onset)
176
+ if ms is None:
177
+ assert hint is None
178
+ else:
179
+ assert hint.endswith(f"audio.input_latency_ms {ms}")
180
+
181
+
182
+ def test_first_loud_sample_inside_a_block():
183
+ block = np.zeros(SR // 2, dtype=np.float32)
184
+ block[4000:] = 0.1
185
+ assert speech._first_loud_sample(block.reshape(-1, 1), 0.01, SR) == 3840 # its 20 ms frame
@@ -0,0 +1,181 @@
1
+ """The setup wizard offering Parakeet to English users without sherpa-onnx."""
2
+ from __future__ import annotations
3
+
4
+ import sys
5
+
6
+ import pytest
7
+
8
+ from voiceio.core.decoders import catalog, fetch, sherpa
9
+ from voiceio.core.decoders.sherpa import SherpaFeatures
10
+ from voiceio.setup import noninteractive, speech, steps
11
+ from test_setup import _patch_noninteractive, cfg_paths # noqa: F401 — fixture
12
+
13
+ # conftest replaces `sherpa.features` in every test; keep the real one.
14
+ REAL_FEATURES = sherpa.features
15
+ FIXED = SherpaFeatures(installed=True, length_reward=True, pretokenized_hotwords=True)
16
+
17
+
18
+ @pytest.fixture
19
+ def installable(monkeypatch):
20
+ """English user, no sherpa-onnx, an environment the installer can write to."""
21
+ monkeypatch.setattr(fetch, "can_install_sherpa", lambda: True)
22
+
23
+
24
+ @pytest.fixture
25
+ def wizard(monkeypatch):
26
+ """Run `_step_model` with the menu answer given; record downloads."""
27
+ downloads: list[str] = []
28
+ monkeypatch.setattr(steps, "_download_model", lambda name: downloads.append(name) or True)
29
+ monkeypatch.setattr(steps, "_ask_yn", lambda *a, **k: False)
30
+ monkeypatch.setattr(steps, "_print_step", lambda *a: None)
31
+
32
+ def run(answer: int = 0, language: str = "en") -> tuple[steps.SetupState, list, list]:
33
+ shown: list = []
34
+
35
+ def ask(options, default=0):
36
+ shown.append((list(options), default))
37
+ return answer
38
+ monkeypatch.setattr(steps, "_ask_choice", ask)
39
+ state = steps.SetupState(language=language)
40
+ steps._step_model(state)
41
+ return state, shown, downloads
42
+ return run
43
+
44
+
45
+ def test_english_without_sherpa_offers_parakeet_first_with_install_label(installable):
46
+ choices = speech.model_choices("en", offer_install=True)
47
+ assert choices[0] == speech.PARAKEET_INSTALL_CHOICE
48
+ assert choices[0][0] == catalog.PARAKEET
49
+ assert "installs sherpa-onnx" in choices[0][2]
50
+ assert speech.default_choice(choices) == 0
51
+ assert not any("recommended" in c[2] for c in choices[1:])
52
+ # Only the interactive wizard asks for it.
53
+ assert speech.model_choices("en") is speech.MODELS
54
+
55
+
56
+ def test_choosing_it_runs_the_shared_installer_then_selects_parakeet(
57
+ installable, wizard, monkeypatch):
58
+ calls = []
59
+
60
+ def install(**kw):
61
+ calls.append(kw)
62
+ monkeypatch.setattr(sherpa, "features", lambda: FIXED)
63
+ monkeypatch.setattr(fetch, "install_sherpa", install)
64
+ state, shown, downloads = wizard(0)
65
+ assert shown[0][0][0] == speech.PARAKEET_INSTALL_CHOICE and shown[0][1] == 0
66
+ assert calls == [{"quiet": True}]
67
+ assert state.model_name == catalog.PARAKEET
68
+ assert downloads == [catalog.PARAKEET]
69
+
70
+
71
+ def test_installer_failure_falls_back_to_small_and_setup_goes_on(
72
+ installable, wizard, monkeypatch, capsys):
73
+ def install(**kw):
74
+ raise OSError("no network")
75
+ monkeypatch.setattr(fetch, "install_sherpa", install)
76
+ state, _, downloads = wizard(0)
77
+ assert state.model_name == "small"
78
+ assert downloads == ["small"]
79
+ out = capsys.readouterr().out
80
+ assert "Couldn't install sherpa-onnx (no network)" in out
81
+
82
+
83
+ def test_install_that_still_cannot_load_falls_back(installable, wizard, monkeypatch):
84
+ monkeypatch.setattr(fetch, "install_sherpa", lambda **kw: None) # features unchanged
85
+ state, _, downloads = wizard(0)
86
+ assert state.model_name == "small" and downloads == ["small"]
87
+
88
+
89
+ def test_picking_whisper_does_not_install(installable, wizard, monkeypatch):
90
+ monkeypatch.setattr(fetch, "install_sherpa", lambda **kw: pytest.fail("installed"))
91
+ state, shown, _ = wizard(3)
92
+ assert state.model_name == shown[0][0][3][0] == "small"
93
+
94
+
95
+ def test_non_english_is_unchanged(installable, wizard, monkeypatch):
96
+ assert speech.model_choices("es", offer_install=True) is speech.MODELS
97
+ monkeypatch.setattr(fetch, "install_sherpa", lambda **kw: pytest.fail("installed"))
98
+ state, shown, _ = wizard(2, language="es")
99
+ assert shown[0][0] == speech.MODELS and state.model_name == "small"
100
+
101
+
102
+ def test_already_installed_sherpa_keeps_todays_label(installable, wizard, monkeypatch):
103
+ monkeypatch.setattr(sherpa, "features", lambda: FIXED)
104
+ monkeypatch.setattr(fetch, "install_sherpa", lambda **kw: pytest.fail("installed"))
105
+ assert speech.model_choices("en", offer_install=True)[0] == speech.PARAKEET_CHOICE
106
+ state, _, downloads = wizard(0)
107
+ assert state.model_name == catalog.PARAKEET and downloads == [catalog.PARAKEET]
108
+
109
+
110
+ def test_an_older_sherpa_is_not_swapped_inside_the_wizard(installable, monkeypatch):
111
+ monkeypatch.setattr(sherpa, "features", lambda: SherpaFeatures(installed=True))
112
+ assert speech.model_choices("en", offer_install=True) is speech.MODELS
113
+
114
+
115
+ @pytest.mark.parametrize("where", ["deb", "nix", "uvx", "readonly", "no-pip", "armv7l"])
116
+ def test_not_offered_where_the_install_cannot_work(monkeypatch, tmp_path, where):
117
+ import platform
118
+ import sysconfig
119
+
120
+ import voiceio.install_env as install_env
121
+ import voiceio.service as service
122
+ monkeypatch.setattr(service, "packaged_by", lambda: "deb" if where == "deb" else None)
123
+ monkeypatch.setattr(sys, "prefix", "/nix/store/abc-voiceio" if where == "nix" else
124
+ str(tmp_path))
125
+ monkeypatch.setattr(install_env, "running_ephemeral", lambda: where == "uvx")
126
+ monkeypatch.setattr(platform, "machine", lambda: "armv7l" if where == "armv7l" else "x86_64")
127
+ monkeypatch.setattr(fetch, "_pip_command",
128
+ lambda reinstall=False: None if where == "no-pip" else ["pip"])
129
+ site = tmp_path / "site"
130
+ site.mkdir()
131
+ monkeypatch.setattr(sysconfig, "get_paths",
132
+ lambda: {"purelib": str(site), "platlib": str(site)})
133
+ if where == "readonly":
134
+ monkeypatch.setattr(fetch.os, "access", lambda p, mode: False)
135
+ assert fetch.can_install_sherpa() is False
136
+ assert speech.model_choices("en", offer_install=True) is speech.MODELS
137
+
138
+
139
+ def test_offered_in_a_writable_pip_environment(monkeypatch, tmp_path):
140
+ import platform
141
+ import sysconfig
142
+
143
+ import voiceio.install_env as install_env
144
+ import voiceio.service as service
145
+ monkeypatch.setattr(service, "packaged_by", lambda: None)
146
+ monkeypatch.setattr(sys, "prefix", str(tmp_path))
147
+ monkeypatch.setattr(install_env, "running_ephemeral", lambda: False)
148
+ monkeypatch.setattr(platform, "machine", lambda: "x86_64")
149
+ monkeypatch.setattr(fetch, "_pip_command", lambda reinstall=False: ["pip"])
150
+ monkeypatch.setattr(sysconfig, "get_paths",
151
+ lambda: {"purelib": str(tmp_path), "platlib": str(tmp_path)})
152
+ assert fetch.can_install_sherpa() is True
153
+
154
+
155
+ def test_noninteractive_setup_installs_nothing(installable, cfg_paths, monkeypatch): # noqa: F811
156
+ _patch_noninteractive(monkeypatch)
157
+ monkeypatch.setattr(fetch, "install_sherpa", lambda **kw: pytest.fail("installed"))
158
+ assert noninteractive.run_setup_noninteractive({}) == 0
159
+ from voiceio import config
160
+ assert config.load(cfg_paths).model.name == "small"
161
+
162
+
163
+ def test_install_sherpa_uses_the_shared_pip_path_and_refreshes_detection(monkeypatch):
164
+ monkeypatch.setattr(sherpa, "features", REAL_FEATURES)
165
+ REAL_FEATURES()
166
+ assert REAL_FEATURES.cache_info().currsize == 1
167
+ calls = []
168
+ monkeypatch.setattr(fetch, "_pip_install", lambda args, **kw: calls.append((args, kw)))
169
+ fetch.install_sherpa(quiet=True)
170
+ assert calls == [(["--upgrade", fetch.SHERPA_REQUIREMENT], {"quiet": True})]
171
+ assert REAL_FEATURES.cache_info().currsize == 0
172
+
173
+
174
+ def test_quiet_pip_failure_names_pips_last_line(monkeypatch):
175
+ import subprocess
176
+ import types
177
+ monkeypatch.setattr(fetch, "_pip_command", lambda reinstall=False: ["pip", "install"])
178
+ monkeypatch.setattr(subprocess, "run", lambda cmd, **kw: types.SimpleNamespace(
179
+ returncode=1, stderr="Collecting x\nERROR: No matching distribution\n"))
180
+ with pytest.raises(OSError, match="No matching distribution"):
181
+ fetch._pip_install(["sherpa-onnx>=2.0.2"], quiet=True)
@@ -0,0 +1 @@
1
+ __version__ = "1.18.18"