python-voiceio 1.17.2__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.
Files changed (238) hide show
  1. {python_voiceio-1.17.2/python_voiceio.egg-info → python_voiceio-1.18.0}/PKG-INFO +5 -2
  2. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/README.md +4 -1
  3. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/pyproject.toml +1 -1
  4. {python_voiceio-1.17.2 → python_voiceio-1.18.0/python_voiceio.egg-info}/PKG-INFO +5 -2
  5. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/python_voiceio.egg-info/SOURCES.txt +2 -0
  6. python_voiceio-1.18.0/tests/test_install_env.py +188 -0
  7. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_setup.py +87 -0
  8. python_voiceio-1.18.0/voiceio/__init__.py +1 -0
  9. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/doctor.py +45 -3
  10. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/health.py +2 -8
  11. python_voiceio-1.18.0/voiceio/install_env.py +169 -0
  12. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/platform.py +63 -8
  13. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/service.py +24 -1
  14. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/noninteractive.py +10 -3
  15. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/steps.py +16 -1
  16. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/system.py +6 -0
  17. python_voiceio-1.17.2/voiceio/__init__.py +0 -1
  18. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/LICENSE +0 -0
  19. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/python_voiceio.egg-info/dependency_links.txt +0 -0
  20. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/python_voiceio.egg-info/entry_points.txt +0 -0
  21. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/python_voiceio.egg-info/requires.txt +0 -0
  22. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/python_voiceio.egg-info/top_level.txt +0 -0
  23. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/setup.cfg +0 -0
  24. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_announce.py +0 -0
  25. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_app_wiring.py +0 -0
  26. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_audio_quality.py +0 -0
  27. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_audio_source.py +0 -0
  28. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_backend_probes.py +0 -0
  29. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_cancel.py +0 -0
  30. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_cli.py +0 -0
  31. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_clipboard_read.py +0 -0
  32. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_clipboard_typer.py +0 -0
  33. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_commands.py +0 -0
  34. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_concurrency_lockdown.py +0 -0
  35. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_config.py +0 -0
  36. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_context_terms.py +0 -0
  37. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_corrections.py +0 -0
  38. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_dead_mic.py +0 -0
  39. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_decoders.py +0 -0
  40. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_engine.py +0 -0
  41. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_errorlog.py +0 -0
  42. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_evdev_uaccess.py +0 -0
  43. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_fallback.py +0 -0
  44. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_fcitx_bridge.py +0 -0
  45. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_feedback_stream.py +0 -0
  46. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_focus.py +0 -0
  47. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_gpu_fallback.py +0 -0
  48. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_health.py +0 -0
  49. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_hints.py +0 -0
  50. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_history.py +0 -0
  51. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_hotkey_modes.py +0 -0
  52. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_engine_limits.py +0 -0
  53. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_engine_listener.py +0 -0
  54. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_pending.py +0 -0
  55. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_pids.py +0 -0
  56. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_ping.py +0 -0
  57. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_session.py +0 -0
  58. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_textlimit.py +0 -0
  59. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_ibus_typer.py +0 -0
  60. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_idle_audio.py +0 -0
  61. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_clean.py +0 -0
  62. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_import.py +0 -0
  63. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_language.py +0 -0
  64. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_metrics.py +0 -0
  65. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_pipeline.py +0 -0
  66. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_quiet.py +0 -0
  67. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_resume.py +0 -0
  68. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_review.py +0 -0
  69. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_learn_targets.py +0 -0
  70. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_llm.py +0 -0
  71. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_llm_api.py +0 -0
  72. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_mic_gain.py +0 -0
  73. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_modifier_guard.py +0 -0
  74. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_numbers.py +0 -0
  75. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_paste_last.py +0 -0
  76. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_pipeline.py +0 -0
  77. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_platform.py +0 -0
  78. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_postcorrect.py +0 -0
  79. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_postprocess.py +0 -0
  80. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_prebuffer.py +0 -0
  81. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_presence.py +0 -0
  82. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_prompt.py +0 -0
  83. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_quiet_audio.py +0 -0
  84. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_recorder_integration.py +0 -0
  85. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_report.py +0 -0
  86. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_retention.py +0 -0
  87. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_robustness.py +0 -0
  88. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_security_hardening.py +0 -0
  89. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_server.py +0 -0
  90. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_service.py +0 -0
  91. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_sherpa.py +0 -0
  92. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_spool.py +0 -0
  93. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_streaming.py +0 -0
  94. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_suggest.py +0 -0
  95. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_tokens.py +0 -0
  96. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_transcriber.py +0 -0
  97. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_tray.py +0 -0
  98. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_tts.py +0 -0
  99. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_typer_manager.py +0 -0
  100. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_vad.py +0 -0
  101. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_vocabulary.py +0 -0
  102. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_wordfreq.py +0 -0
  103. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/tests/test_worker_decode.py +0 -0
  104. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/__main__.py +0 -0
  105. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/announce.py +0 -0
  106. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/app.py +0 -0
  107. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/audio_source.py +0 -0
  108. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/backends.py +0 -0
  109. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/__init__.py +0 -0
  110. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/configcmd.py +0 -0
  111. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/corrections.py +0 -0
  112. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/history.py +0 -0
  113. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/learn.py +0 -0
  114. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/models.py +0 -0
  115. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/servicecmd.py +0 -0
  116. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/uninstall.py +0 -0
  117. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/cli/vocab.py +0 -0
  118. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/clipboard_read.py +0 -0
  119. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/commands.py +0 -0
  120. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/config.py +0 -0
  121. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/consent.py +0 -0
  122. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/context_terms.py +0 -0
  123. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/__init__.py +0 -0
  124. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/bias.py +0 -0
  125. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/__init__.py +0 -0
  126. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/base.py +0 -0
  127. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/catalog.py +0 -0
  128. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
  129. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
  130. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/fetch.py +0 -0
  131. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/lanes.py +0 -0
  132. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/sherpa.py +0 -0
  133. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/decoders/whispercpp.py +0 -0
  134. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/engine.py +0 -0
  135. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/core/pipeline.py +0 -0
  136. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/corrections.py +0 -0
  137. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/data/60-voiceio-uaccess.rules +0 -0
  138. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/data/__init__.py +0 -0
  139. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/demo.py +0 -0
  140. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/display.py +0 -0
  141. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/errorlog.py +0 -0
  142. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/feedback.py +0 -0
  143. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/focus.py +0 -0
  144. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hints.py +0 -0
  145. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/history.py +0 -0
  146. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/__init__.py +0 -0
  147. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/base.py +0 -0
  148. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/chain.py +0 -0
  149. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/evdev.py +0 -0
  150. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/pynput_backend.py +0 -0
  151. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/hotkeys/socket_backend.py +0 -0
  152. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/__init__.py +0 -0
  153. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/engine.py +0 -0
  154. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/install.py +0 -0
  155. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/pending.py +0 -0
  156. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/session.py +0 -0
  157. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ibus/textlimit.py +0 -0
  158. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/idle_audio.py +0 -0
  159. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/__init__.py +0 -0
  160. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/augment.py +0 -0
  161. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/clean.py +0 -0
  162. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/evaluate.py +0 -0
  163. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/importer.py +0 -0
  164. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/metrics.py +0 -0
  165. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/quiet.py +0 -0
  166. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/review.py +0 -0
  167. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/store.py +0 -0
  168. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/teacher.py +0 -0
  169. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/learn/train.py +0 -0
  170. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/llm.py +0 -0
  171. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/llm_api.py +0 -0
  172. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/mic_gain.py +0 -0
  173. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/models/__init__.py +0 -0
  174. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/models/silero_vad.onnx +0 -0
  175. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/numbers.py +0 -0
  176. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/pidlock.py +0 -0
  177. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/postcorrect.py +0 -0
  178. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/postprocess.py +0 -0
  179. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/power.py +0 -0
  180. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/presence.py +0 -0
  181. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/privacy.py +0 -0
  182. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/prompt.py +0 -0
  183. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/quiet_audio.py +0 -0
  184. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/recorder.py +0 -0
  185. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/report.py +0 -0
  186. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/retention.py +0 -0
  187. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/server/__init__.py +0 -0
  188. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/server/__main__.py +0 -0
  189. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/server/app.py +0 -0
  190. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/server/config.py +0 -0
  191. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/server/runtime.py +0 -0
  192. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/__init__.py +0 -0
  193. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/configfile.py +0 -0
  194. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/extras.py +0 -0
  195. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/hotkey.py +0 -0
  196. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/speech.py +0 -0
  197. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/setup/ui.py +0 -0
  198. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/sounds/__init__.py +0 -0
  199. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/sounds/alert.wav +0 -0
  200. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/sounds/commit.wav +0 -0
  201. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/sounds/start.wav +0 -0
  202. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/sounds/stop.wav +0 -0
  203. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/spool.py +0 -0
  204. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/streaming.py +0 -0
  205. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/suggest.py +0 -0
  206. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tokens.py +0 -0
  207. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tray/__init__.py +0 -0
  208. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tray/_icons.py +0 -0
  209. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tray/_indicator.py +0 -0
  210. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tray/_pystray.py +0 -0
  211. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/__init__.py +0 -0
  212. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/base.py +0 -0
  213. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/chain.py +0 -0
  214. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/edge_engine.py +0 -0
  215. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/espeak.py +0 -0
  216. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/piper_engine.py +0 -0
  217. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/player.py +0 -0
  218. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/tts/supertonic_engine.py +0 -0
  219. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/__init__.py +0 -0
  220. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/base.py +0 -0
  221. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/chain.py +0 -0
  222. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/clipboard.py +0 -0
  223. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/collecting.py +0 -0
  224. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/fcitx_bridge.py +0 -0
  225. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/ibus.py +0 -0
  226. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/manager.py +0 -0
  227. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/modifier_guard.py +0 -0
  228. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/paste.py +0 -0
  229. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/pynput_type.py +0 -0
  230. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/wtype.py +0 -0
  231. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/xdotool.py +0 -0
  232. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/typers/ydotool.py +0 -0
  233. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/ui.py +0 -0
  234. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/vad.py +0 -0
  235. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/vocab_stats.py +0 -0
  236. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/vocabulary.py +0 -0
  237. {python_voiceio-1.17.2 → python_voiceio-1.18.0}/voiceio/watchdog.py +0 -0
  238. {python_voiceio-1.17.2 → 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.17.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-voiceio"
7
- version = "1.17.2"
7
+ version = "1.18.0"
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.17.2
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
@@ -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
- healthy = report.all_ok and not perm_issues and not missing_deps and not report.warnings
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:
@@ -80,15 +80,9 @@ def check_health(p: plat.Platform | None = None) -> HealthReport:
80
80
  ))
81
81
 
82
82
  # Check audio
83
- try:
83
+ report.audio_reason = plat.audio_problem()
84
+ if not report.audio_reason:
84
85
  import sounddevice as _sd
85
- except OSError:
86
- # sounddevice imports but PortAudio's shared library is missing.
87
- report.audio_reason = ("PortAudio library not found — install: "
88
- + plat.system_deps_install_cmd(["portaudio"]))
89
- except ImportError:
90
- report.audio_reason = plat.desktop_dep_hint("sounddevice")
91
- else:
92
86
  try:
93
87
  _sd.query_devices(kind="input")
94
88
  report.audio_ok = True
@@ -0,0 +1,169 @@
1
+ """Where this voiceio install lives, and whether it will still be there tomorrow.
2
+
3
+ `uvx 'python-voiceio[desktop]'` runs voiceio from a throwaway environment in
4
+ uv's cache (``~/.cache/uv/archive-v0/<hash>/``). uv deletes it on
5
+ ``uv cache clean`` / ``uv cache prune`` or when a newer version is resolved, so
6
+ a systemd unit, IBus launcher or ~/.local/bin link that points there breaks
7
+ some day without warning. Setup refuses to write such paths, and doctor flags
8
+ the ones already written.
9
+ """
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ import sys
14
+ from pathlib import Path
15
+
16
+ UV_TOOL_INSTALL = "uv tool install 'python-voiceio[desktop]'"
17
+ PIPX_INSTALL = "pipx install 'python-voiceio[desktop]'"
18
+
19
+ # The Cache Directory Tagging Specification (bford.info/cachedir): a directory
20
+ # holding this file, with this first line, is a cache whose contents may be
21
+ # deleted at any time. uv writes it at the root of every cache it uses,
22
+ # including the temporary one of `uvx --no-cache`.
23
+ CACHEDIR_TAG = "CACHEDIR.TAG"
24
+ _CACHEDIR_SIGNATURE = "Signature: 8a477f597d28d172789f06886806bc55"
25
+
26
+
27
+ def uv_cache_dir() -> Path:
28
+ """uv's default cache directory, resolved the way uv resolves it:
29
+ $UV_CACHE_DIR, else the platform cache dir ($XDG_CACHE_HOME or ~/.cache
30
+ on Linux and macOS, %LOCALAPPDATA% on Windows) + ``uv``."""
31
+ if env := os.environ.get("UV_CACHE_DIR"):
32
+ return Path(env).expanduser()
33
+ if sys.platform == "win32":
34
+ base = os.environ.get("LOCALAPPDATA") or str(Path.home() / "AppData" / "Local")
35
+ return Path(base) / "uv" / "cache"
36
+ xdg = os.environ.get("XDG_CACHE_HOME", "")
37
+ # XDG: a relative value is invalid and must be ignored.
38
+ base = Path(xdg) if xdg and os.path.isabs(xdg) else Path.home() / ".cache"
39
+ return base / "uv"
40
+
41
+
42
+ def _is_cachedir(d: Path) -> bool:
43
+ try:
44
+ with open(d / CACHEDIR_TAG, encoding="utf-8", errors="replace") as f:
45
+ return f.read(len(_CACHEDIR_SIGNATURE)) == _CACHEDIR_SIGNATURE
46
+ except OSError:
47
+ return False
48
+
49
+
50
+ def in_uv_cache(path: str | os.PathLike) -> bool:
51
+ """True when ``path`` lies inside uv's cache (or any tagged cache dir).
52
+
53
+ Two checks, either suffices: the path is under uv_cache_dir(), or one of
54
+ its parent directories carries a CACHEDIR.TAG (catches `--cache-dir`,
55
+ `--no-cache` and a UV_CACHE_DIR that differed when the file was written).
56
+ uv sets no variable that marks an ephemeral run: `$UV` is also set by
57
+ `uv run` in a project and inherited by every child, and pyvenv.cfg's
58
+ `uv = ...` line is also in `uv tool install` and `uv venv` environments.
59
+ """
60
+ p = Path(os.path.abspath(os.path.expanduser(os.fspath(path))))
61
+ try:
62
+ p = p.resolve()
63
+ except OSError:
64
+ pass
65
+ cache = uv_cache_dir()
66
+ for c in {cache, Path(os.path.abspath(cache))}:
67
+ try:
68
+ c = c.resolve()
69
+ except OSError:
70
+ pass
71
+ if p == c or c in p.parents:
72
+ return True
73
+ return any(_is_cachedir(d) for d in p.parents if d != d.parent)
74
+
75
+
76
+ def running_ephemeral() -> bool:
77
+ """This interpreter runs from a uvx environment that uv may delete."""
78
+ return in_uv_cache(sys.prefix)
79
+
80
+
81
+ def persistent_install_hint() -> str:
82
+ """What to run instead of uvx, for messages."""
83
+ return (f"Install voiceio permanently, then run setup again:\n"
84
+ f" {UV_TOOL_INSTALL} (or: {PIPX_INSTALL})\n"
85
+ f" voiceio setup")
86
+
87
+
88
+ def ephemeral_message() -> str:
89
+ """Why setup refuses to run from a uvx environment, and what to do."""
90
+ return (f"voiceio is running from a temporary uvx environment ({sys.prefix}).\n"
91
+ "uv deletes it on `uv cache clean`, `uv cache prune` or the next version, so\n"
92
+ "the autostart service and IBus launcher setup writes would stop working.\n"
93
+ + persistent_install_hint())
94
+
95
+
96
+ def _exec_start(unit: Path) -> str | None:
97
+ """The program a systemd unit runs (ExecStart's first word)."""
98
+ import shlex
99
+ try:
100
+ text = unit.read_text()
101
+ except OSError:
102
+ return None
103
+ for line in text.splitlines():
104
+ if line.startswith("ExecStart="):
105
+ try:
106
+ words = shlex.split(line.removeprefix("ExecStart="))
107
+ except ValueError:
108
+ return None
109
+ # Strip systemd's special-executable prefixes (-, @, :, +, !).
110
+ return words[0].lstrip("-@:+!") if words else None
111
+ return None
112
+
113
+
114
+ def _launcher_paths(launcher: Path) -> list[str]:
115
+ """Paths the IBus launcher bakes in: VOICEIO_PKG_ROOT, SYSTEM_PY, INSTALL_PY."""
116
+ try:
117
+ text = launcher.read_text()
118
+ except OSError:
119
+ return []
120
+ found = []
121
+ for line in text.splitlines():
122
+ for var in ("VOICEIO_PKG_ROOT", "SYSTEM_PY", "INSTALL_PY"):
123
+ if line.startswith(f'{var}="') and line.endswith('"'):
124
+ found.append(line[len(var) + 2:-1])
125
+ return found
126
+
127
+
128
+ def stale_install_paths() -> list[tuple[str, str, str]]:
129
+ """(what, path, problem) for each file voiceio wrote whose program lives
130
+ in uv's cache or no longer exists. Empty when everything is durable."""
131
+ from voiceio import service
132
+ from voiceio.ibus import install as ibus_install
133
+
134
+ refs: list[tuple[str, str]] = []
135
+ for label, unit in (("autostart service", service.SERVICE_PATH),
136
+ ("learning service", service.LEARN_SERVICE_PATH)):
137
+ if prog := _exec_start(unit):
138
+ refs.append((f"{label} {unit}", prog))
139
+ refs += [(f"IBus launcher {ibus_install.LAUNCHER_PATH}", p)
140
+ for p in _launcher_paths(ibus_install.LAUNCHER_PATH)]
141
+ for name in service.SCRIPT_NAMES:
142
+ link = service.LOCAL_BIN / name
143
+ if link.is_symlink():
144
+ refs.append((f"command link {link}", os.path.join(link.parent, os.readlink(link))))
145
+
146
+ stale = []
147
+ for what, path in refs:
148
+ if not os.path.isabs(path):
149
+ continue # a bare name (`voiceio`) is looked up on PATH at run time
150
+ cached = in_uv_cache(path)
151
+ exists = os.path.exists(path)
152
+ if cached:
153
+ stale.append((what, path, "in uv's cache" if exists
154
+ else "in uv's cache, already deleted"))
155
+ elif not exists:
156
+ stale.append((what, path, "no longer exists"))
157
+ return stale
158
+
159
+
160
+ def stale_paths_report(stale: list[tuple[str, str, str]]) -> str:
161
+ """Doctor's text for stale_install_paths() findings."""
162
+ lines = ["\nInstall paths that will break (or already did):"]
163
+ lines += [f" ✗ {what}\n → {path} ({problem})" for what, path, problem in stale]
164
+ if running_ephemeral():
165
+ lines.append("\n" + ephemeral_message())
166
+ else:
167
+ lines.append("\nRun 'voiceio doctor --fix' or 'voiceio setup' to rewrite them for this "
168
+ "install.\nIf voiceio came from uvx: " + persistent_install_hint())
169
+ return "\n".join(lines)