python-voiceio 1.17.2__tar.gz → 1.18.1__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 (239) hide show
  1. {python_voiceio-1.17.2/python_voiceio.egg-info → python_voiceio-1.18.1}/PKG-INFO +5 -2
  2. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/README.md +4 -1
  3. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/pyproject.toml +1 -1
  4. {python_voiceio-1.17.2 → python_voiceio-1.18.1/python_voiceio.egg-info}/PKG-INFO +5 -2
  5. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/python_voiceio.egg-info/SOURCES.txt +3 -0
  6. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_evdev_uaccess.py +7 -6
  7. python_voiceio-1.18.1/tests/test_evdev_x11_optional.py +199 -0
  8. python_voiceio-1.18.1/tests/test_install_env.py +188 -0
  9. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_security_hardening.py +2 -2
  10. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_setup.py +162 -3
  11. python_voiceio-1.18.1/voiceio/__init__.py +1 -0
  12. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/doctor.py +50 -9
  13. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/uninstall.py +2 -2
  14. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/health.py +28 -8
  15. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/evdev.py +42 -11
  16. python_voiceio-1.18.1/voiceio/install_env.py +169 -0
  17. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/platform.py +129 -23
  18. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/service.py +24 -1
  19. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/noninteractive.py +14 -3
  20. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/steps.py +23 -5
  21. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/system.py +20 -5
  22. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/ydotool.py +12 -9
  23. python_voiceio-1.17.2/voiceio/__init__.py +0 -1
  24. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/LICENSE +0 -0
  25. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/python_voiceio.egg-info/dependency_links.txt +0 -0
  26. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/python_voiceio.egg-info/entry_points.txt +0 -0
  27. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/python_voiceio.egg-info/requires.txt +0 -0
  28. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/python_voiceio.egg-info/top_level.txt +0 -0
  29. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/setup.cfg +0 -0
  30. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_announce.py +0 -0
  31. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_app_wiring.py +0 -0
  32. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_audio_quality.py +0 -0
  33. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_audio_source.py +0 -0
  34. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_backend_probes.py +0 -0
  35. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_cancel.py +0 -0
  36. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_cli.py +0 -0
  37. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_clipboard_read.py +0 -0
  38. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_clipboard_typer.py +0 -0
  39. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_commands.py +0 -0
  40. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_concurrency_lockdown.py +0 -0
  41. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_config.py +0 -0
  42. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_context_terms.py +0 -0
  43. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_corrections.py +0 -0
  44. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_dead_mic.py +0 -0
  45. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_decoders.py +0 -0
  46. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_engine.py +0 -0
  47. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_errorlog.py +0 -0
  48. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_fallback.py +0 -0
  49. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_fcitx_bridge.py +0 -0
  50. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_feedback_stream.py +0 -0
  51. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_focus.py +0 -0
  52. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_gpu_fallback.py +0 -0
  53. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_health.py +0 -0
  54. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_hints.py +0 -0
  55. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_history.py +0 -0
  56. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_hotkey_modes.py +0 -0
  57. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_engine_limits.py +0 -0
  58. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_engine_listener.py +0 -0
  59. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_pending.py +0 -0
  60. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_pids.py +0 -0
  61. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_ping.py +0 -0
  62. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_session.py +0 -0
  63. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_textlimit.py +0 -0
  64. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_ibus_typer.py +0 -0
  65. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_idle_audio.py +0 -0
  66. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_clean.py +0 -0
  67. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_import.py +0 -0
  68. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_language.py +0 -0
  69. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_metrics.py +0 -0
  70. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_pipeline.py +0 -0
  71. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_quiet.py +0 -0
  72. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_resume.py +0 -0
  73. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_review.py +0 -0
  74. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_learn_targets.py +0 -0
  75. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_llm.py +0 -0
  76. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_llm_api.py +0 -0
  77. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_mic_gain.py +0 -0
  78. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_modifier_guard.py +0 -0
  79. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_numbers.py +0 -0
  80. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_paste_last.py +0 -0
  81. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_pipeline.py +0 -0
  82. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_platform.py +0 -0
  83. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_postcorrect.py +0 -0
  84. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_postprocess.py +0 -0
  85. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_prebuffer.py +0 -0
  86. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_presence.py +0 -0
  87. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_prompt.py +0 -0
  88. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_quiet_audio.py +0 -0
  89. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_recorder_integration.py +0 -0
  90. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_report.py +0 -0
  91. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_retention.py +0 -0
  92. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_robustness.py +0 -0
  93. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_server.py +0 -0
  94. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_service.py +0 -0
  95. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_sherpa.py +0 -0
  96. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_spool.py +0 -0
  97. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_streaming.py +0 -0
  98. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_suggest.py +0 -0
  99. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_tokens.py +0 -0
  100. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_transcriber.py +0 -0
  101. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_tray.py +0 -0
  102. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_tts.py +0 -0
  103. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_typer_manager.py +0 -0
  104. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_vad.py +0 -0
  105. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_vocabulary.py +0 -0
  106. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_wordfreq.py +0 -0
  107. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/tests/test_worker_decode.py +0 -0
  108. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/__main__.py +0 -0
  109. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/announce.py +0 -0
  110. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/app.py +0 -0
  111. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/audio_source.py +0 -0
  112. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/backends.py +0 -0
  113. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/__init__.py +0 -0
  114. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/configcmd.py +0 -0
  115. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/corrections.py +0 -0
  116. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/history.py +0 -0
  117. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/learn.py +0 -0
  118. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/models.py +0 -0
  119. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/servicecmd.py +0 -0
  120. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/cli/vocab.py +0 -0
  121. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/clipboard_read.py +0 -0
  122. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/commands.py +0 -0
  123. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/config.py +0 -0
  124. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/consent.py +0 -0
  125. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/context_terms.py +0 -0
  126. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/__init__.py +0 -0
  127. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/bias.py +0 -0
  128. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/__init__.py +0 -0
  129. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/base.py +0 -0
  130. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/catalog.py +0 -0
  131. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
  132. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
  133. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/fetch.py +0 -0
  134. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/lanes.py +0 -0
  135. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/sherpa.py +0 -0
  136. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/decoders/whispercpp.py +0 -0
  137. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/engine.py +0 -0
  138. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/core/pipeline.py +0 -0
  139. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/corrections.py +0 -0
  140. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/data/60-voiceio-uaccess.rules +0 -0
  141. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/data/__init__.py +0 -0
  142. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/demo.py +0 -0
  143. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/display.py +0 -0
  144. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/errorlog.py +0 -0
  145. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/feedback.py +0 -0
  146. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/focus.py +0 -0
  147. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hints.py +0 -0
  148. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/history.py +0 -0
  149. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/__init__.py +0 -0
  150. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/base.py +0 -0
  151. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/chain.py +0 -0
  152. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/pynput_backend.py +0 -0
  153. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/hotkeys/socket_backend.py +0 -0
  154. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/__init__.py +0 -0
  155. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/engine.py +0 -0
  156. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/install.py +0 -0
  157. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/pending.py +0 -0
  158. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/session.py +0 -0
  159. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ibus/textlimit.py +0 -0
  160. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/idle_audio.py +0 -0
  161. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/__init__.py +0 -0
  162. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/augment.py +0 -0
  163. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/clean.py +0 -0
  164. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/evaluate.py +0 -0
  165. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/importer.py +0 -0
  166. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/metrics.py +0 -0
  167. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/quiet.py +0 -0
  168. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/review.py +0 -0
  169. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/store.py +0 -0
  170. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/teacher.py +0 -0
  171. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/learn/train.py +0 -0
  172. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/llm.py +0 -0
  173. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/llm_api.py +0 -0
  174. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/mic_gain.py +0 -0
  175. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/models/__init__.py +0 -0
  176. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/models/silero_vad.onnx +0 -0
  177. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/numbers.py +0 -0
  178. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/pidlock.py +0 -0
  179. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/postcorrect.py +0 -0
  180. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/postprocess.py +0 -0
  181. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/power.py +0 -0
  182. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/presence.py +0 -0
  183. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/privacy.py +0 -0
  184. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/prompt.py +0 -0
  185. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/quiet_audio.py +0 -0
  186. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/recorder.py +0 -0
  187. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/report.py +0 -0
  188. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/retention.py +0 -0
  189. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/server/__init__.py +0 -0
  190. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/server/__main__.py +0 -0
  191. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/server/app.py +0 -0
  192. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/server/config.py +0 -0
  193. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/server/runtime.py +0 -0
  194. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/__init__.py +0 -0
  195. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/configfile.py +0 -0
  196. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/extras.py +0 -0
  197. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/hotkey.py +0 -0
  198. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/speech.py +0 -0
  199. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/setup/ui.py +0 -0
  200. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/sounds/__init__.py +0 -0
  201. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/sounds/alert.wav +0 -0
  202. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/sounds/commit.wav +0 -0
  203. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/sounds/start.wav +0 -0
  204. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/sounds/stop.wav +0 -0
  205. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/spool.py +0 -0
  206. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/streaming.py +0 -0
  207. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/suggest.py +0 -0
  208. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tokens.py +0 -0
  209. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tray/__init__.py +0 -0
  210. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tray/_icons.py +0 -0
  211. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tray/_indicator.py +0 -0
  212. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tray/_pystray.py +0 -0
  213. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/__init__.py +0 -0
  214. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/base.py +0 -0
  215. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/chain.py +0 -0
  216. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/edge_engine.py +0 -0
  217. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/espeak.py +0 -0
  218. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/piper_engine.py +0 -0
  219. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/player.py +0 -0
  220. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/tts/supertonic_engine.py +0 -0
  221. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/__init__.py +0 -0
  222. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/base.py +0 -0
  223. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/chain.py +0 -0
  224. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/clipboard.py +0 -0
  225. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/collecting.py +0 -0
  226. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/fcitx_bridge.py +0 -0
  227. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/ibus.py +0 -0
  228. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/manager.py +0 -0
  229. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/modifier_guard.py +0 -0
  230. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/paste.py +0 -0
  231. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/pynput_type.py +0 -0
  232. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/wtype.py +0 -0
  233. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/typers/xdotool.py +0 -0
  234. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/ui.py +0 -0
  235. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/vad.py +0 -0
  236. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/vocab_stats.py +0 -0
  237. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/vocabulary.py +0 -0
  238. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/voiceio/watchdog.py +0 -0
  239. {python_voiceio-1.17.2 → python_voiceio-1.18.1}/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.1
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.1"
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.1
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
@@ -26,6 +26,7 @@ tests/test_decoders.py
26
26
  tests/test_engine.py
27
27
  tests/test_errorlog.py
28
28
  tests/test_evdev_uaccess.py
29
+ tests/test_evdev_x11_optional.py
29
30
  tests/test_fallback.py
30
31
  tests/test_fcitx_bridge.py
31
32
  tests/test_feedback_stream.py
@@ -44,6 +45,7 @@ tests/test_ibus_session.py
44
45
  tests/test_ibus_textlimit.py
45
46
  tests/test_ibus_typer.py
46
47
  tests/test_idle_audio.py
48
+ tests/test_install_env.py
47
49
  tests/test_learn_clean.py
48
50
  tests/test_learn_import.py
49
51
  tests/test_learn_language.py
@@ -109,6 +111,7 @@ voiceio/health.py
109
111
  voiceio/hints.py
110
112
  voiceio/history.py
111
113
  voiceio/idle_audio.py
114
+ voiceio/install_env.py
112
115
  voiceio/llm.py
113
116
  voiceio/llm_api.py
114
117
  voiceio/mic_gain.py
@@ -31,13 +31,13 @@ def test_rule_ships_as_package_data():
31
31
  assert (ROOT / "voiceio" / "data" / "__init__.py").exists()
32
32
 
33
33
 
34
- def test_install_cmd_is_single_sudo_script():
34
+ def test_install_cmd_is_single_root_script():
35
35
  cmd = evdev_mod.uaccess_install_cmd()
36
- assert cmd[:2] == ["sh", "-c"] and len(cmd) == 3
37
- script = cmd[2]
38
- assert f"sudo tee {evdev_mod.UACCESS_RULE_PATH}" in script
39
- assert "sudo udevadm control --reload-rules" in script
40
- assert "sudo udevadm trigger" in script
36
+ assert cmd[:3] == ["sudo", "sh", "-c"] and len(cmd) == 4
37
+ script = cmd[3]
38
+ assert f"> {evdev_mod.UACCESS_RULE_PATH}" in script
39
+ assert "udevadm control --reload-rules" in script
40
+ assert "udevadm trigger" in script
41
41
  assert "uaccess" in script
42
42
  assert "usermod" not in script
43
43
 
@@ -60,6 +60,7 @@ def _deny_all_inputs(monkeypatch, tmp_path):
60
60
 
61
61
  def test_probe_offers_uaccess_rule(monkeypatch, tmp_path):
62
62
  monkeypatch.setattr("voiceio.platform.is_nixos", lambda: False)
63
+ monkeypatch.setattr(evdev_mod, "_pynput_covers_hotkey", lambda: False)
63
64
  _deny_all_inputs(monkeypatch, tmp_path)
64
65
  result = evdev_mod.EvdevHotkey().probe()
65
66
  assert not result.ok
@@ -0,0 +1,199 @@
1
+ """On X11 pynput covers the hotkey: evdev access (a root-only udev rule) is
2
+ optional there, and setup/doctor must not fail on it or offer the install."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from types import SimpleNamespace
7
+ from unittest.mock import MagicMock, patch
8
+
9
+ import pytest
10
+
11
+ from voiceio import config, health
12
+ from voiceio import platform as plat
13
+ from voiceio.backends import ProbeResult
14
+ from voiceio.hotkeys import evdev as evdev_mod
15
+ from voiceio.platform import Platform
16
+
17
+ _DENIED = ProbeResult(ok=False, reason="No permission to read /dev/input",
18
+ fix_hint="install udev rule", fix_cmd=evdev_mod.uaccess_install_cmd())
19
+
20
+
21
+ def _cfg(backend="auto"):
22
+ return SimpleNamespace(hotkey=SimpleNamespace(backend=backend),
23
+ llm=SimpleNamespace(enabled=False))
24
+
25
+
26
+ def _report(display, pynput_ok=True, backend="auto", monkeypatch=None):
27
+ monkeypatch.setattr(config, "load", lambda *a, **k: _cfg(backend))
28
+ p = Platform(os="linux", display_server=display, desktop="kde")
29
+ chain = ([("pynput", MagicMock(), ProbeResult(ok=pynput_ok, reason="pynput missing"))]
30
+ if display == "x11" else [])
31
+ chain += [("evdev", MagicMock(), _DENIED), ("socket", MagicMock(), ProbeResult(ok=True))]
32
+ with patch("voiceio.health.hotkey_chain.resolve", lambda platform: chain), \
33
+ patch("voiceio.health.typer_chain.resolve",
34
+ lambda platform: [("xdotool", MagicMock(), ProbeResult(ok=True))]), \
35
+ patch.dict("sys.modules", {"sounddevice": MagicMock()}):
36
+ return health.check_health(p)
37
+
38
+
39
+ def _evdev(report):
40
+ return next(b for b in report.hotkey_backends if b.name == "evdev")
41
+
42
+
43
+ @pytest.mark.parametrize("display,pynput_ok,backend,expected", [
44
+ ("x11", True, "auto", True),
45
+ ("x11", True, "pynput", True),
46
+ ("x11", True, "evdev", False), # pinned: evdev is the hotkey
47
+ ("x11", False, "auto", False), # no pynput: evdev is next in the chain
48
+ ("wayland", True, "auto", False), # evdev is the only physical listener
49
+ ("unknown", True, "auto", False),
50
+ ])
51
+ def test_evdev_optional(display, pynput_ok, backend, expected):
52
+ assert evdev_mod.evdev_optional(display, pynput_ok, backend) is expected
53
+
54
+
55
+ def test_doctor_shows_evdev_optional_on_x11_with_pynput(monkeypatch):
56
+ report = _report("x11", monkeypatch=monkeypatch)
57
+ b = _evdev(report)
58
+ assert b.optional and not b.fix_cmd and not b.fix_hint
59
+ assert report.all_ok
60
+ line = next(ln for ln in health.format_report(report).splitlines() if "evdev" in ln)
61
+ assert "pynput handles the hotkey on X11" in line
62
+ assert "✗" not in line
63
+ assert "udev" not in health.format_report(report)
64
+
65
+
66
+ @pytest.mark.parametrize("display,pynput_ok,backend", [
67
+ ("wayland", True, "auto"), ("x11", False, "auto"), ("x11", True, "evdev"),
68
+ ])
69
+ def test_doctor_keeps_evdev_fix_elsewhere(monkeypatch, display, pynput_ok, backend):
70
+ b = _evdev(_report(display, pynput_ok, backend, monkeypatch=monkeypatch))
71
+ assert not b.optional
72
+ assert b.fix_cmd == evdev_mod.uaccess_install_cmd()
73
+
74
+
75
+ def _run_doctor_fix(monkeypatch, report):
76
+ from voiceio import install_env
77
+ from voiceio.cli import doctor
78
+ privileged, ran = [], []
79
+ monkeypatch.setattr(health, "check_health", lambda: report)
80
+ monkeypatch.setattr(health, "format_report", lambda r: "")
81
+ monkeypatch.setattr(health, "usage_findings", lambda: [])
82
+ monkeypatch.setattr(plat, "check_system_deps", lambda: [])
83
+ monkeypatch.setattr(config, "check_permissions", lambda: [])
84
+ monkeypatch.setattr(install_env, "stale_install_paths", lambda: [])
85
+ monkeypatch.setattr(install_env, "running_ephemeral", lambda: False)
86
+ monkeypatch.setattr(doctor, "_offer_report", lambda *a: False)
87
+ monkeypatch.setattr(doctor, "_run_privileged", lambda *a, **k: privileged.append(a))
88
+ monkeypatch.setattr("subprocess.run", lambda *a, **k: ran.append(a))
89
+ report.cli_in_path = True
90
+ with pytest.raises(SystemExit):
91
+ doctor._cmd_doctor(argparse.Namespace(live=False, fix=True, report=False))
92
+ return privileged, ran
93
+
94
+
95
+ def test_doctor_fix_skips_udev_install_on_x11_with_pynput(monkeypatch):
96
+ privileged, ran = _run_doctor_fix(monkeypatch, _report("x11", monkeypatch=monkeypatch))
97
+ assert privileged == [] and ran == []
98
+
99
+
100
+ def test_doctor_fix_still_offers_udev_install_on_wayland(monkeypatch):
101
+ privileged, _ = _run_doctor_fix(monkeypatch, _report("wayland", monkeypatch=monkeypatch))
102
+ assert [a[0] for a in privileged] == ["Fix evdev"]
103
+
104
+
105
+ def test_probe_drops_udev_fix_when_pynput_covers(monkeypatch, tmp_path):
106
+ from pathlib import Path
107
+ monkeypatch.setattr("voiceio.platform.is_nixos", lambda: False)
108
+ monkeypatch.setattr(evdev_mod, "_pynput_covers_hotkey", lambda: True)
109
+ (tmp_path / "event0").write_text("")
110
+ monkeypatch.setattr(Path, "glob", lambda self, pat: [tmp_path / "event0"])
111
+
112
+ def deny(*a, **k):
113
+ raise PermissionError
114
+ monkeypatch.setattr("builtins.open", deny)
115
+ result = evdev_mod.EvdevHotkey().probe()
116
+ assert not result.ok and not result.fix_cmd
117
+ assert result.fix_hint == evdev_mod.NOT_NEEDED_ON_X11
118
+
119
+
120
+ def test_pynput_covers_hotkey_reads_display_and_config(monkeypatch):
121
+ from voiceio.hotkeys import pynput_backend
122
+ monkeypatch.setattr(pynput_backend.PynputHotkey, "probe", lambda self: ProbeResult(ok=True))
123
+ monkeypatch.setattr(plat, "_detect_display_server", lambda: "x11")
124
+ monkeypatch.setattr(config, "load", lambda *a, **k: _cfg("auto"))
125
+ assert evdev_mod._pynput_covers_hotkey()
126
+ monkeypatch.setattr(config, "load", lambda *a, **k: _cfg("evdev"))
127
+ assert not evdev_mod._pynput_covers_hotkey()
128
+ monkeypatch.setattr(config, "load", lambda *a, **k: _cfg("auto"))
129
+ monkeypatch.setattr(plat, "_detect_display_server", lambda: "wayland")
130
+ assert not evdev_mod._pynput_covers_hotkey()
131
+
132
+
133
+ # ── setup ────────────────────────────────────────────────────────────────
134
+
135
+ _CHECKS = {
136
+ "is_windows": False, "is_mac": False, "is_linux": True, "display": "x11",
137
+ "audio": True, "audio_devices": [object()], "pynput": True, "xdotool": True,
138
+ "xclip": False, "ydotool": False, "wtype": False, "ibus": False, "ibus_gi": False,
139
+ "cuda": False, "evdev_access": False, "evdev_optional": True,
140
+ }
141
+
142
+
143
+ def test_setup_shows_evdev_optional_on_x11(capsys):
144
+ from voiceio.setup import steps
145
+ steps._print_capability_checks(dict(_CHECKS))
146
+ line = next(ln for ln in capsys.readouterr().out.splitlines() if "evdev" in ln)
147
+ assert "pynput handles the hotkey on X11" in line
148
+ assert "✗" not in line and "doctor --fix" not in line
149
+
150
+
151
+ def test_setup_keeps_evdev_hint_on_wayland(capsys, monkeypatch):
152
+ from voiceio.setup import steps
153
+ monkeypatch.setattr("voiceio.platform.is_nixos", lambda: False)
154
+ steps._print_capability_checks(dict(_CHECKS, display="wayland", pynput=False,
155
+ evdev_optional=False))
156
+ line = next(ln for ln in capsys.readouterr().out.splitlines() if "evdev" in ln)
157
+ assert "✗" in line and "doctor --fix" in line
158
+
159
+
160
+ def test_check_system_detects_pynput_on_startx_x11(monkeypatch):
161
+ """XDG_SESSION_TYPE=tty under startx: DISPLAY still says X11."""
162
+ from voiceio.hotkeys import pynput_backend
163
+ from voiceio.setup import system
164
+ monkeypatch.setenv("XDG_SESSION_TYPE", "tty")
165
+ monkeypatch.setenv("DISPLAY", ":0")
166
+ monkeypatch.delenv("WAYLAND_DISPLAY", raising=False)
167
+ monkeypatch.setattr("sys.platform", "linux")
168
+ monkeypatch.setattr(plat, "_detect_os", lambda: "linux")
169
+ monkeypatch.setattr(pynput_backend.PynputHotkey, "probe", lambda self: ProbeResult(ok=True))
170
+ monkeypatch.setattr(evdev_mod.EvdevHotkey, "probe", lambda self: _DENIED)
171
+ checks = system._check_system()
172
+ assert checks["display"] == "x11"
173
+ assert checks["pynput"] and not checks["evdev_access"] and checks["evdev_optional"]
174
+
175
+
176
+ def test_setup_picks_auto_backend_on_x11_without_evdev(monkeypatch):
177
+ from voiceio.setup import steps
178
+ monkeypatch.setattr("voiceio.ibus.install.ensure", lambda: True)
179
+ state = steps.SetupState(checks=dict(_CHECKS))
180
+ steps._select_output_backend(state)
181
+ assert state.backend == "auto" # pynput first, not the socket-only fallback
182
+
183
+
184
+ # ── install commands ─────────────────────────────────────────────────────
185
+
186
+ @pytest.mark.parametrize("cmd,rule_path", [
187
+ (evdev_mod.uaccess_install_cmd(), evdev_mod.UACCESS_RULE_PATH),
188
+ ])
189
+ def test_install_cmd_creates_rules_dir_first(cmd, rule_path):
190
+ script = cmd[-1]
191
+ assert cmd[:3] == ["sudo", "sh", "-c"]
192
+ assert script.index("mkdir -p /etc/udev/rules.d") < script.index(f"> {rule_path}")
193
+ assert "sudo" not in script
194
+
195
+
196
+ def test_ydotool_install_cmd_creates_rules_dir_first():
197
+ from voiceio.typers import ydotool
198
+ test_install_cmd_creates_rules_dir_first(ydotool.uinput_udev_install_cmd(),
199
+ ydotool.UINPUT_UDEV_RULE_PATH)
@@ -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
@@ -188,7 +188,7 @@ def test_uinput_install_cmd_uses_sudo_not_chmod_0666():
188
188
  from voiceio.typers import ydotool
189
189
  cmd = ydotool.uinput_udev_install_cmd()
190
190
  joined = " ".join(cmd)
191
- assert "sudo tee" in joined
191
+ assert cmd[0] == "sudo" and "> /etc/udev/rules.d/" in joined
192
192
  assert "udevadm control --reload-rules" in joined
193
193
  assert "chmod 0666" not in joined
194
194
 
@@ -201,7 +201,7 @@ def test_ydotool_probe_offers_udev_not_chmod(monkeypatch):
201
201
  result = ydotool.YdotoolTyper().probe()
202
202
  assert not result.ok
203
203
  assert "chmod 0666" not in " ".join(result.fix_cmd)
204
- assert "sudo tee" in " ".join(result.fix_cmd)
204
+ assert result.fix_cmd[0] == "sudo" and "udevadm" in " ".join(result.fix_cmd)
205
205
 
206
206
 
207
207
  # ── doctor --fix consent prompt for privileged actions ───────────────────