webbee 0.5.5__tar.gz → 0.5.7__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 (145) hide show
  1. {webbee-0.5.5 → webbee-0.5.7}/CHANGELOG.md +16 -0
  2. {webbee-0.5.5 → webbee-0.5.7}/PKG-INFO +38 -29
  3. {webbee-0.5.5 → webbee-0.5.7}/README.md +18 -13
  4. {webbee-0.5.5 → webbee-0.5.7}/pyproject.toml +25 -17
  5. webbee-0.5.7/src/webbee/__init__.py +1 -0
  6. webbee-0.5.7/src/webbee/_launch.py +206 -0
  7. webbee-0.5.7/tests/test_launch.py +181 -0
  8. webbee-0.5.5/src/webbee/__init__.py +0 -1
  9. {webbee-0.5.5 → webbee-0.5.7}/.github/workflows/publish.yml +0 -0
  10. {webbee-0.5.5 → webbee-0.5.7}/.gitignore +0 -0
  11. {webbee-0.5.5 → webbee-0.5.7}/LICENSE +0 -0
  12. {webbee-0.5.5 → webbee-0.5.7}/install.sh +0 -0
  13. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/__main__.py +0 -0
  14. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/account.py +0 -0
  15. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/active_sessions.py +0 -0
  16. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/banner_art.py +0 -0
  17. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/boot.py +0 -0
  18. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/browser.py +0 -0
  19. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/checkpoints.py +0 -0
  20. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/cli.py +0 -0
  21. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/clipboard.py +0 -0
  22. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/clipboard_read.py +0 -0
  23. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/clipboard_session.py +0 -0
  24. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/coding_context.py +0 -0
  25. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/commands.py +0 -0
  26. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/config.py +0 -0
  27. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/consent.py +0 -0
  28. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/details.py +0 -0
  29. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/events.py +0 -0
  30. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/frames.py +0 -0
  31. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/home.py +0 -0
  32. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/home_view.py +0 -0
  33. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/http.py +0 -0
  34. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/instance_lock.py +0 -0
  35. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/__init__.py +0 -0
  36. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/graph.py +0 -0
  37. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/outline.py +0 -0
  38. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/query.py +0 -0
  39. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/service.py +0 -0
  40. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/store.py +0 -0
  41. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/vectors.py +0 -0
  42. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/intel/watch.py +0 -0
  43. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/media.py +0 -0
  44. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/modals.py +0 -0
  45. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/mode_store.py +0 -0
  46. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/native_files.py +0 -0
  47. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/native_read.py +0 -0
  48. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/newtab_mode.py +0 -0
  49. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/output_pane.py +0 -0
  50. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/pricing_constants.py +0 -0
  51. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/queue_panel.py +0 -0
  52. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/reflow.py +0 -0
  53. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/remote.py +0 -0
  54. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/render.py +0 -0
  55. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/repl.py +0 -0
  56. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/repo.py +0 -0
  57. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/selection.py +0 -0
  58. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/session.py +0 -0
  59. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/sessions.py +0 -0
  60. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/sizing.py +0 -0
  61. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/slots.py +0 -0
  62. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/steer.py +0 -0
  63. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/stream.py +0 -0
  64. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tab_store.py +0 -0
  65. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tabs.py +0 -0
  66. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/thread.py +0 -0
  67. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tier_store.py +0 -0
  68. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/todo_panel.py +0 -0
  69. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tokens.py +0 -0
  70. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tools.py +0 -0
  71. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/tui.py +0 -0
  72. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/update.py +0 -0
  73. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/urlopen.py +0 -0
  74. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/wallet.py +0 -0
  75. {webbee-0.5.5 → webbee-0.5.7}/src/webbee/worktrees.py +0 -0
  76. {webbee-0.5.5 → webbee-0.5.7}/tests/__init__.py +0 -0
  77. {webbee-0.5.5 → webbee-0.5.7}/tests/conftest.py +0 -0
  78. {webbee-0.5.5 → webbee-0.5.7}/tests/test_account.py +0 -0
  79. {webbee-0.5.5 → webbee-0.5.7}/tests/test_active_sessions.py +0 -0
  80. {webbee-0.5.5 → webbee-0.5.7}/tests/test_audit_2026_07_25_findings.py +0 -0
  81. {webbee-0.5.5 → webbee-0.5.7}/tests/test_checkpoints.py +0 -0
  82. {webbee-0.5.5 → webbee-0.5.7}/tests/test_cli.py +0 -0
  83. {webbee-0.5.5 → webbee-0.5.7}/tests/test_clipboard.py +0 -0
  84. {webbee-0.5.5 → webbee-0.5.7}/tests/test_clipboard_read.py +0 -0
  85. {webbee-0.5.5 → webbee-0.5.7}/tests/test_coding_context.py +0 -0
  86. {webbee-0.5.5 → webbee-0.5.7}/tests/test_commands.py +0 -0
  87. {webbee-0.5.5 → webbee-0.5.7}/tests/test_config.py +0 -0
  88. {webbee-0.5.5 → webbee-0.5.7}/tests/test_cpc_contract_stable.py +0 -0
  89. {webbee-0.5.5 → webbee-0.5.7}/tests/test_cpc_outline.py +0 -0
  90. {webbee-0.5.5 → webbee-0.5.7}/tests/test_cross_loop_token.py +0 -0
  91. {webbee-0.5.5 → webbee-0.5.7}/tests/test_details.py +0 -0
  92. {webbee-0.5.5 → webbee-0.5.7}/tests/test_events.py +0 -0
  93. {webbee-0.5.5 → webbee-0.5.7}/tests/test_freeze_fix.py +0 -0
  94. {webbee-0.5.5 → webbee-0.5.7}/tests/test_home.py +0 -0
  95. {webbee-0.5.5 → webbee-0.5.7}/tests/test_home_view.py +0 -0
  96. {webbee-0.5.5 → webbee-0.5.7}/tests/test_home_view_mouse.py +0 -0
  97. {webbee-0.5.5 → webbee-0.5.7}/tests/test_inspect_page.py +0 -0
  98. {webbee-0.5.5 → webbee-0.5.7}/tests/test_instance_lock.py +0 -0
  99. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_chunker.py +0 -0
  100. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_embed.py +0 -0
  101. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_graph.py +0 -0
  102. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_no_numpy.py +0 -0
  103. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_query.py +0 -0
  104. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_service.py +0 -0
  105. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_store.py +0 -0
  106. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_vectors.py +0 -0
  107. {webbee-0.5.5 → webbee-0.5.7}/tests/test_intel_watch.py +0 -0
  108. {webbee-0.5.5 → webbee-0.5.7}/tests/test_marathon.py +0 -0
  109. {webbee-0.5.5 → webbee-0.5.7}/tests/test_modals_e2e.py +0 -0
  110. {webbee-0.5.5 → webbee-0.5.7}/tests/test_mode_store.py +0 -0
  111. {webbee-0.5.5 → webbee-0.5.7}/tests/test_native_files.py +0 -0
  112. {webbee-0.5.5 → webbee-0.5.7}/tests/test_newtab_mode.py +0 -0
  113. {webbee-0.5.5 → webbee-0.5.7}/tests/test_packaging.py +0 -0
  114. {webbee-0.5.5 → webbee-0.5.7}/tests/test_queue_manage_0337.py +0 -0
  115. {webbee-0.5.5 → webbee-0.5.7}/tests/test_reflow.py +0 -0
  116. {webbee-0.5.5 → webbee-0.5.7}/tests/test_render.py +0 -0
  117. {webbee-0.5.5 → webbee-0.5.7}/tests/test_repl.py +0 -0
  118. {webbee-0.5.5 → webbee-0.5.7}/tests/test_repo.py +0 -0
  119. {webbee-0.5.5 → webbee-0.5.7}/tests/test_resilient_http.py +0 -0
  120. {webbee-0.5.5 → webbee-0.5.7}/tests/test_session.py +0 -0
  121. {webbee-0.5.5 → webbee-0.5.7}/tests/test_sessions.py +0 -0
  122. {webbee-0.5.5 → webbee-0.5.7}/tests/test_sizing.py +0 -0
  123. {webbee-0.5.5 → webbee-0.5.7}/tests/test_slots.py +0 -0
  124. {webbee-0.5.5 → webbee-0.5.7}/tests/test_steer.py +0 -0
  125. {webbee-0.5.5 → webbee-0.5.7}/tests/test_stream.py +0 -0
  126. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tab_bar_stability.py +0 -0
  127. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tab_restore_0337.py +0 -0
  128. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tabs.py +0 -0
  129. {webbee-0.5.5 → webbee-0.5.7}/tests/test_terminal_ux_0336.py +0 -0
  130. {webbee-0.5.5 → webbee-0.5.7}/tests/test_thread.py +0 -0
  131. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tier_invalidation.py +0 -0
  132. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tier_store.py +0 -0
  133. {webbee-0.5.5 → webbee-0.5.7}/tests/test_todo_panel.py +0 -0
  134. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tokens.py +0 -0
  135. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tools.py +0 -0
  136. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tools_vision_websearch.py +0 -0
  137. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tui.py +0 -0
  138. {webbee-0.5.5 → webbee-0.5.7}/tests/test_tui_hardening.py +0 -0
  139. {webbee-0.5.5 → webbee-0.5.7}/tests/test_update.py +0 -0
  140. {webbee-0.5.5 → webbee-0.5.7}/tests/test_update_badge_0340.py +0 -0
  141. {webbee-0.5.5 → webbee-0.5.7}/tests/test_urlopen.py +0 -0
  142. {webbee-0.5.5 → webbee-0.5.7}/tests/test_version.py +0 -0
  143. {webbee-0.5.5 → webbee-0.5.7}/tests/test_version_badge_corner.py +0 -0
  144. {webbee-0.5.5 → webbee-0.5.7}/tests/test_wallet.py +0 -0
  145. {webbee-0.5.5 → webbee-0.5.7}/tests/test_worktrees.py +0 -0
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.7
4
+
5
+ * **The one-time Python 3.12 setup cannot be steered by the folder it starts in**: uv now runs with
6
+ `--no-config` from the launcher's own folder, so a `uv.toml`, `pyproject.toml` or `.python-version` in
7
+ someone's repository can no longer pick the package index or the interpreter for the runtime.
8
+
9
+ ## 0.5.6
10
+
11
+ * **`pip install webbee` works on Python 3.7, 3.8 and 3.9** (macOS ships 3.9): webbee's dependencies need
12
+ 3.10+, so on an older Python the install is light and the `webbee` command (`webbee/_launch.py`, standard
13
+ library only, 3.7 syntax) sets up the same release on its own Python 3.12 once with uv, then hands over.
14
+ It is the full webbee -- code index and search by meaning included. uv comes as a wheel on 3.8+; on 3.7
15
+ the launcher downloads uv's release build from GitHub and checks its published SHA-256. On 3.10+ nothing
16
+ changes. Checked on clean Python 3.7 (arm64, x86_64), 3.8, 3.9 (incl. macOS's own with pip 21) and 3.12.
17
+ * **README**: one install section for every Python, and the errors people actually hit.
18
+
3
19
  ## 0.5.5
4
20
 
5
21
  * **Installs on Python 3.10 again**: pip and pipx stopped with "conflicting dependencies / ResolutionImpossible"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: webbee
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Webbee 🐝 — the Imperal Cloud coding agent in your terminal
5
5
  Project-URL: Homepage, https://imperal.io
6
6
  Project-URL: Documentation, https://docs.imperal.io
@@ -17,6 +17,9 @@ Classifier: Environment :: Console
17
17
  Classifier: Intended Audience :: Developers
18
18
  Classifier: Operating System :: OS Independent
19
19
  Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.7
21
+ Classifier: Programming Language :: Python :: 3.8
22
+ Classifier: Programming Language :: Python :: 3.9
20
23
  Classifier: Programming Language :: Python :: 3.10
21
24
  Classifier: Programming Language :: Python :: 3.11
22
25
  Classifier: Programming Language :: Python :: 3.12
@@ -24,21 +27,22 @@ Classifier: Programming Language :: Python :: 3.13
24
27
  Classifier: Programming Language :: Python :: 3.14
25
28
  Classifier: Topic :: Software Development
26
29
  Classifier: Topic :: Utilities
27
- Requires-Python: >=3.10
28
- Requires-Dist: asyncssh>=2.14
29
- Requires-Dist: httpx-sse>=0.4
30
- Requires-Dist: httpx>=0.27
31
- Requires-Dist: imperal-mcp>=0.5.7
32
- Requires-Dist: imperal-sdk>=6.3.6
33
- Requires-Dist: model2vec>=0.8.2; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
34
- Requires-Dist: numpy>=2; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
35
- Requires-Dist: prompt-toolkit>=3
36
- Requires-Dist: rich>=13.7
37
- Requires-Dist: tree-sitter-javascript>=0.23; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
38
- Requires-Dist: tree-sitter-python>=0.23; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
39
- Requires-Dist: tree-sitter-typescript>=0.23; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
40
- Requires-Dist: tree-sitter>=0.23; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
41
- Requires-Dist: watchfiles>=0.24; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'
30
+ Requires-Python: >=3.7
31
+ Requires-Dist: asyncssh>=2.14; python_version >= '3.10'
32
+ Requires-Dist: httpx-sse>=0.4; python_version >= '3.10'
33
+ Requires-Dist: httpx>=0.27; python_version >= '3.10'
34
+ Requires-Dist: imperal-mcp>=0.5.7; python_version >= '3.10'
35
+ Requires-Dist: imperal-sdk>=6.3.6; python_version >= '3.10'
36
+ Requires-Dist: model2vec>=0.8.2; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
37
+ Requires-Dist: numpy>=2; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
38
+ Requires-Dist: prompt-toolkit>=3; python_version >= '3.10'
39
+ Requires-Dist: rich>=13.7; python_version >= '3.10'
40
+ Requires-Dist: tree-sitter-javascript>=0.23; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
41
+ Requires-Dist: tree-sitter-python>=0.23; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
42
+ Requires-Dist: tree-sitter-typescript>=0.23; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
43
+ Requires-Dist: tree-sitter>=0.23; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
44
+ Requires-Dist: uv>=0.4; python_version >= '3.8' and python_version < '3.10'
45
+ Requires-Dist: watchfiles>=0.24; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
42
46
  Provides-Extra: intel
43
47
  Provides-Extra: intel-embed
44
48
  Provides-Extra: intel-embed-faiss
@@ -78,32 +82,37 @@ Webbee is powered by **ICNLI** (*Infrastructure Contextual Natural Language Inte
78
82
 
79
83
  ## 📦 Installation
80
84
 
81
- One line — installs [uv](https://docs.astral.sh/uv/) if needed, which brings its own Python:
82
-
83
85
  ```sh
84
- curl -LsSf https://raw.githubusercontent.com/imperalcloud/webbee-code/main/install.sh | sh
86
+ pipx install webbee
87
+ # or: uv tool install webbee
88
+ # or: pip install webbee (inside a virtual environment)
85
89
  ```
86
90
 
87
- Or, if you already have uv or pipx:
91
+ No Python tools at hand? One line installs [uv](https://docs.astral.sh/uv/) (it brings its own Python) and webbee:
88
92
 
89
93
  ```sh
90
- uv tool install webbee
91
- # or:
92
- pipx install webbee
94
+ curl -LsSf https://raw.githubusercontent.com/imperalcloud/webbee-code/main/install.sh | sh
93
95
  ```
94
96
 
95
- Webbee needs **Python 3.10 or newer**. `uv` fetches a suitable Python by itself, so it works even where
96
- the system Python is older (macOS ships 3.9).
97
+ Works with **any Python from 3.7**:
98
+
99
+ - **Python 3.10 or newer** — webbee runs directly on it.
100
+ - **Python 3.7 – 3.9** (macOS ships 3.9, Ubuntu 20.04 has 3.8) — the install is light, and the first
101
+ `webbee` command sets up the same release on its own Python 3.12, once (about 30–45 s, needs internet;
102
+ it fetches uv to do it). Every start after that is immediate, and it is the full webbee — code index
103
+ and search by meaning included. It lives in `~/.local/share/webbee/runtime`
104
+ (`%LOCALAPPDATA%\webbee\runtime` on Windows) and changes nothing else on your system.
97
105
 
98
106
  <details>
99
107
  <summary>Install problems</summary>
100
108
 
101
109
  | You see | Why | Do |
102
110
  |---------|-----|----|
103
- | `Cannot install webbee==… because these package versions have conflicting dependencies` / `ResolutionImpossible` | pip/pipx runs on a Python older than 3.10 (or webbee < 0.5.5 on Python 3.10) | `uv tool install webbee`, or `pipx install --python python3.12 webbee` |
104
- | `No matching distribution found for webbee` | Python older than 3.10 | same as above |
105
- | `error: externally-managed-environment` | `pip install` into the system Python is blocked on Homebrew, Debian 12+, Ubuntu 23.04+ | `uv tool install webbee` or `pipx install webbee` |
106
- | `webbee: command not found` after install | the tool folder is not on `PATH` | `uv tool update-shell` (or `pipx ensurepath`), then open a new terminal |
111
+ | `Cannot install webbee==… because these package versions have conflicting dependencies` / `ResolutionImpossible` | a webbee release older than 0.5.6 on Python below 3.10 | `pipx install "webbee>=0.5.6"` (or `pip install -U webbee`) |
112
+ | `error: externally-managed-environment` | `pip install` into the system Python is blocked on Homebrew, Debian 12+, Ubuntu 23.04+ | `pipx install webbee` or `uv tool install webbee` |
113
+ | `webbee: command not found` after install | the tool folder is not on `PATH` | `pipx ensurepath` (or `uv tool update-shell`), then open a new terminal |
114
+ | `Could not set up webbee on Python 3.12` on the first start | Python 3.7–3.9 and no internet (or a proxy blocks github.com / pypi.org) | allow those hosts and start `webbee` again, or use the one-line installer above |
115
+ | `No matching distribution found for webbee` | Python 3.6 or older | the one-line installer above — it brings its own Python |
107
116
 
108
117
  </details>
109
118
 
@@ -27,32 +27,37 @@ Webbee is powered by **ICNLI** (*Infrastructure Contextual Natural Language Inte
27
27
 
28
28
  ## 📦 Installation
29
29
 
30
- One line — installs [uv](https://docs.astral.sh/uv/) if needed, which brings its own Python:
31
-
32
30
  ```sh
33
- curl -LsSf https://raw.githubusercontent.com/imperalcloud/webbee-code/main/install.sh | sh
31
+ pipx install webbee
32
+ # or: uv tool install webbee
33
+ # or: pip install webbee (inside a virtual environment)
34
34
  ```
35
35
 
36
- Or, if you already have uv or pipx:
36
+ No Python tools at hand? One line installs [uv](https://docs.astral.sh/uv/) (it brings its own Python) and webbee:
37
37
 
38
38
  ```sh
39
- uv tool install webbee
40
- # or:
41
- pipx install webbee
39
+ curl -LsSf https://raw.githubusercontent.com/imperalcloud/webbee-code/main/install.sh | sh
42
40
  ```
43
41
 
44
- Webbee needs **Python 3.10 or newer**. `uv` fetches a suitable Python by itself, so it works even where
45
- the system Python is older (macOS ships 3.9).
42
+ Works with **any Python from 3.7**:
43
+
44
+ - **Python 3.10 or newer** — webbee runs directly on it.
45
+ - **Python 3.7 – 3.9** (macOS ships 3.9, Ubuntu 20.04 has 3.8) — the install is light, and the first
46
+ `webbee` command sets up the same release on its own Python 3.12, once (about 30–45 s, needs internet;
47
+ it fetches uv to do it). Every start after that is immediate, and it is the full webbee — code index
48
+ and search by meaning included. It lives in `~/.local/share/webbee/runtime`
49
+ (`%LOCALAPPDATA%\webbee\runtime` on Windows) and changes nothing else on your system.
46
50
 
47
51
  <details>
48
52
  <summary>Install problems</summary>
49
53
 
50
54
  | You see | Why | Do |
51
55
  |---------|-----|----|
52
- | `Cannot install webbee==… because these package versions have conflicting dependencies` / `ResolutionImpossible` | pip/pipx runs on a Python older than 3.10 (or webbee < 0.5.5 on Python 3.10) | `uv tool install webbee`, or `pipx install --python python3.12 webbee` |
53
- | `No matching distribution found for webbee` | Python older than 3.10 | same as above |
54
- | `error: externally-managed-environment` | `pip install` into the system Python is blocked on Homebrew, Debian 12+, Ubuntu 23.04+ | `uv tool install webbee` or `pipx install webbee` |
55
- | `webbee: command not found` after install | the tool folder is not on `PATH` | `uv tool update-shell` (or `pipx ensurepath`), then open a new terminal |
56
+ | `Cannot install webbee==… because these package versions have conflicting dependencies` / `ResolutionImpossible` | a webbee release older than 0.5.6 on Python below 3.10 | `pipx install "webbee>=0.5.6"` (or `pip install -U webbee`) |
57
+ | `error: externally-managed-environment` | `pip install` into the system Python is blocked on Homebrew, Debian 12+, Ubuntu 23.04+ | `pipx install webbee` or `uv tool install webbee` |
58
+ | `webbee: command not found` after install | the tool folder is not on `PATH` | `pipx ensurepath` (or `uv tool update-shell`), then open a new terminal |
59
+ | `Could not set up webbee on Python 3.12` on the first start | Python 3.7–3.9 and no internet (or a proxy blocks github.com / pypi.org) | allow those hosts and start `webbee` again, or use the one-line installer above |
60
+ | `No matching distribution found for webbee` | Python 3.6 or older | the one-line installer above — it brings its own Python |
56
61
 
57
62
  </details>
58
63
 
@@ -1,20 +1,25 @@
1
1
  [project]
2
2
  name = "webbee"
3
- version = "0.5.5"
3
+ version = "0.5.7"
4
4
  description = "Webbee 🐝 — the Imperal Cloud coding agent in your terminal"
5
5
  readme = "README.md"
6
6
  license = "GPL-3.0-or-later"
7
7
  license-files = ["LICENSE"]
8
- requires-python = ">=3.10"
8
+ requires-python = ">=3.7"
9
9
  authors = [{ name = "Valentin Scerbacov", email = "valentin@imperal.io" }, { name = "Imperal, Inc." }]
10
10
  dependencies = [
11
- "imperal-mcp>=0.5.7",
12
- "imperal-sdk>=6.3.6",
13
- "asyncssh>=2.14",
14
- "httpx>=0.27",
15
- "httpx-sse>=0.4",
16
- "rich>=13.7",
17
- "prompt_toolkit>=3",
11
+ # Every dependency below needs Python 3.10+ (the MCP SDK, numpy 2, tree-sitter). On 3.7-3.9
12
+ # pip installs none of them, and the `webbee` command (webbee/_launch.py) runs this same
13
+ # release on a Python 3.12 it sets up once with uv -- `uv` comes as a wheel on 3.8+,
14
+ # 3.7 fetches it with uv's own installer.
15
+ 'uv>=0.4; python_version >= "3.8" and python_version < "3.10"',
16
+ 'imperal-mcp>=0.5.7; python_version >= "3.10"',
17
+ 'imperal-sdk>=6.3.6; python_version >= "3.10"',
18
+ 'asyncssh>=2.14; python_version >= "3.10"',
19
+ 'httpx>=0.27; python_version >= "3.10"',
20
+ 'httpx-sse>=0.4; python_version >= "3.10"',
21
+ 'rich>=13.7; python_version >= "3.10"',
22
+ 'prompt_toolkit>=3; python_version >= "3.10"',
18
23
  # --- code intelligence (CPC): the symbol/graph index is NOT optional ---
19
24
  # Without these the indexer silently yields 0 symbols (boot.py degrades to
20
25
  # intel=None), so repo_profile / graph_slice / search_code / impact_of_change
@@ -26,15 +31,15 @@ dependencies = [
26
31
  # macosx_x86_64 wheel is cp312, and numpy stops there too). On that one
27
32
  # platform the install stays green and intel fails soft to lexical+graph
28
33
  # or off, exactly as tests/test_intel_no_numpy.py guarantees.
29
- 'tree-sitter>=0.23; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
30
- 'tree-sitter-python>=0.23; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
31
- 'tree-sitter-typescript>=0.23; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
32
- 'tree-sitter-javascript>=0.23; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
33
- 'watchfiles>=0.24; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
34
+ 'tree-sitter>=0.23; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
35
+ 'tree-sitter-python>=0.23; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
36
+ 'tree-sitter-typescript>=0.23; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
37
+ 'tree-sitter-javascript>=0.23; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
38
+ 'watchfiles>=0.24; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
34
39
  # Semantic arm: model2vec is pure-numpy (no ONNX toolchain), so it installs
35
40
  # wherever wheels exist -- same platform carve-out as above.
36
- 'model2vec>=0.8.2; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
37
- 'numpy>=2; sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13"',
41
+ 'model2vec>=0.8.2; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
42
+ 'numpy>=2; python_version >= "3.10" and (sys_platform != "darwin" or platform_machine != "x86_64" or python_version < "3.13")',
38
43
  ]
39
44
  keywords = ["webbee", "imperal", "icnli", "coding-agent", "ai-agent", "cli", "terminal", "llm"]
40
45
  classifiers = [
@@ -42,6 +47,9 @@ classifiers = [
42
47
  "Environment :: Console",
43
48
  "Intended Audience :: Developers",
44
49
  "Programming Language :: Python :: 3",
50
+ "Programming Language :: Python :: 3.7",
51
+ "Programming Language :: Python :: 3.8",
52
+ "Programming Language :: Python :: 3.9",
45
53
  "Programming Language :: Python :: 3.10",
46
54
  "Programming Language :: Python :: 3.11",
47
55
  "Programming Language :: Python :: 3.12",
@@ -77,7 +85,7 @@ Issues = "https://github.com/imperalcloud/webbee-code/issues"
77
85
  Protocol = "https://icnli.org"
78
86
 
79
87
  [project.scripts]
80
- webbee = "webbee.cli:main"
88
+ webbee = "webbee._launch:main"
81
89
 
82
90
  [build-system]
83
91
  requires = ["hatchling"]
@@ -0,0 +1 @@
1
+ __version__ = "0.5.7"
@@ -0,0 +1,206 @@
1
+ """The `webbee` command on any Python from 3.7.
2
+
3
+ Webbee needs Python 3.10+ -- its dependencies do (the MCP SDK, numpy 2, tree-sitter). On
4
+ 3.10+ this hands straight to webbee.cli. On an older Python pip installs webbee without those
5
+ dependencies, and this command runs the SAME webbee release on a Python 3.12 it sets up once
6
+ with uv in its own folder: the person gets the whole agent, never a reduced one.
7
+
8
+ Kept to Python 3.7 syntax and the standard library: it is the only module an old interpreter
9
+ ever runs. imperal-mcp carries the same launcher (imperal_mcp/_launch.py)."""
10
+ import hashlib
11
+ import io
12
+ import os
13
+ import platform
14
+ import shutil
15
+ import subprocess
16
+ import sys
17
+ import tarfile
18
+ import urllib.request
19
+ import zipfile
20
+
21
+ DIST = "webbee"
22
+ ENTRY_MODULE, ENTRY_FUNC = "webbee.cli", "main"
23
+ NATIVE = (3, 10) # the Python the dependencies need
24
+ RUNTIME_PYTHON = "3.12"
25
+ SPEC_ENV = "WEBBEE_RUNTIME_SPEC" # what to install instead of DIST==version (tests, mirrors)
26
+ HOME_ENV = "WEBBEE_RUNTIME_HOME"
27
+ _WINDOWS = os.name == "nt"
28
+
29
+
30
+ def _version():
31
+ from webbee import __version__
32
+ return __version__ # the light install on an old Python and its runtime are one release
33
+
34
+
35
+ def _home():
36
+ if os.environ.get(HOME_ENV):
37
+ return os.environ[HOME_ENV]
38
+ if _WINDOWS:
39
+ base = os.environ.get("LOCALAPPDATA") or os.path.expanduser("~")
40
+ else:
41
+ base = os.environ.get("XDG_DATA_HOME") or os.path.join(os.path.expanduser("~"), ".local", "share")
42
+ return os.path.join(base, DIST, "runtime")
43
+
44
+
45
+ def _say(msg):
46
+ sys.stderr.write(msg + "\n")
47
+ sys.stderr.flush()
48
+
49
+
50
+ def _bin(prefix, name):
51
+ if _WINDOWS:
52
+ return os.path.join(prefix, "Scripts", name + ".exe")
53
+ return os.path.join(prefix, "bin", name)
54
+
55
+
56
+ def _find_uv(home):
57
+ """uv from the pip-installed `uv` package (Python 3.8+), PATH, the usual install folders,
58
+ or our own earlier bootstrap -- else None."""
59
+ try:
60
+ import uv # noqa: F401 -- the PyPI `uv` package ships the binary
61
+ found = uv.find_uv_bin()
62
+ if found and os.path.exists(found):
63
+ return found
64
+ except Exception:
65
+ pass
66
+ name = "uv.exe" if _WINDOWS else "uv"
67
+ candidates = [shutil.which("uv"), os.path.join(home, "uv", name)]
68
+ for d in (os.path.join("~", ".local", "bin"), os.path.join("~", ".cargo", "bin")):
69
+ candidates.append(os.path.join(os.path.expanduser(d), name))
70
+ for c in candidates:
71
+ if c and os.path.exists(c):
72
+ return c
73
+ return None
74
+
75
+
76
+ UV_RELEASES = "https://github.com/astral-sh/uv/releases/latest/download/"
77
+
78
+
79
+ def _uv_target():
80
+ """uv's release name for this machine, e.g. x86_64-unknown-linux-gnu."""
81
+ machine = platform.machine().lower()
82
+ arch = {"x86_64": "x86_64", "amd64": "x86_64", "aarch64": "aarch64", "arm64": "aarch64",
83
+ "i686": "i686", "i386": "i686", "armv7l": "armv7", "ppc64le": "powerpc64le",
84
+ "s390x": "s390x"}.get(machine)
85
+ if arch is None:
86
+ raise RuntimeError("no uv build for a %s machine" % machine)
87
+ if sys.platform == "darwin":
88
+ return arch + "-apple-darwin"
89
+ if _WINDOWS:
90
+ return arch + "-pc-windows-msvc"
91
+ libc = platform.libc_ver()[0]
92
+ if arch == "armv7":
93
+ return "armv7-unknown-linux-" + ("gnueabihf" if libc == "glibc" else "musleabihf")
94
+ return arch + "-unknown-linux-" + ("gnu" if libc == "glibc" else "musl")
95
+
96
+
97
+ def _fetch(url):
98
+ req = urllib.request.Request(url, headers={"User-Agent": DIST + "-launcher"})
99
+ with urllib.request.urlopen(req, timeout=120) as r:
100
+ return r.read()
101
+
102
+
103
+ def _install_uv(home):
104
+ """Python 3.7 has no `uv` wheel: download uv's release build for this machine from GitHub,
105
+ check it against the published SHA-256 and unpack it into our own folder. Standard library
106
+ only -- no curl, no installer script, no PATH or shell-profile changes."""
107
+ target = _uv_target()
108
+ archive = "uv-" + target + (".zip" if _WINDOWS else ".tar.gz")
109
+ _say("Fetching uv (it brings the Python %s %s runs on)..." % (RUNTIME_PYTHON, DIST))
110
+ data = _fetch(UV_RELEASES + archive)
111
+ expected = _fetch(UV_RELEASES + archive + ".sha256").decode().split()[0].lower()
112
+ if hashlib.sha256(data).hexdigest() != expected:
113
+ raise RuntimeError("uv download does not match its published SHA-256")
114
+ dest = os.path.join(home, "uv")
115
+ shutil.rmtree(dest, ignore_errors=True)
116
+ os.makedirs(dest)
117
+ name = "uv.exe" if _WINDOWS else "uv"
118
+ if _WINDOWS:
119
+ with zipfile.ZipFile(io.BytesIO(data)) as z:
120
+ member = next(m for m in z.namelist() if m.rsplit("/", 1)[-1] == name)
121
+ with open(os.path.join(dest, name), "wb") as f:
122
+ f.write(z.read(member))
123
+ else:
124
+ with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as t:
125
+ member = next(m for m in t.getmembers() if m.isfile() and m.name.rsplit("/", 1)[-1] == name)
126
+ with open(os.path.join(dest, name), "wb") as f:
127
+ f.write(t.extractfile(member).read())
128
+ os.chmod(os.path.join(dest, name), 0o755)
129
+ return os.path.join(dest, name)
130
+
131
+
132
+ class _Lock(object):
133
+ """One setup at a time when two terminals start webbee together."""
134
+
135
+ def __init__(self, path):
136
+ self.path, self.f = path, None
137
+
138
+ def __enter__(self):
139
+ self.f = open(self.path, "a+")
140
+ try:
141
+ if _WINDOWS:
142
+ import msvcrt
143
+ msvcrt.locking(self.f.fileno(), msvcrt.LK_LOCK, 1)
144
+ else:
145
+ import fcntl
146
+ fcntl.flock(self.f.fileno(), fcntl.LOCK_EX)
147
+ except Exception:
148
+ pass # no lock beats no start
149
+ return self
150
+
151
+ def __exit__(self, *exc):
152
+ self.f.close()
153
+
154
+
155
+ def runtime(version):
156
+ """Path of the `DIST` command in a Python 3.12 environment holding this exact release;
157
+ set up on the first call, reused after."""
158
+ home = _home()
159
+ os.makedirs(home, exist_ok=True)
160
+ prefix = os.path.join(home, "py" + RUNTIME_PYTHON + "-" + version)
161
+ exe = _bin(prefix, DIST)
162
+ ready = os.path.join(prefix, ".ready")
163
+ if os.path.exists(ready) and os.path.exists(exe):
164
+ return exe
165
+ with _Lock(os.path.join(home, ".setup.lock")):
166
+ if os.path.exists(ready) and os.path.exists(exe):
167
+ return exe # the other terminal finished it meanwhile
168
+ _say("Python %d.%d is older than %s needs (%d.%d): setting up %s %s on Python %s "
169
+ "once, in %s ..." % (sys.version_info[0], sys.version_info[1], DIST, NATIVE[0], NATIVE[1],
170
+ DIST, version, RUNTIME_PYTHON, prefix))
171
+ uv = _find_uv(home) or _install_uv(home)
172
+ shutil.rmtree(prefix, ignore_errors=True) # a half-made one from an interrupted setup
173
+ # --no-config and cwd=home: started inside someone's repository, a uv.toml, pyproject.toml
174
+ # or .python-version there must not pick the index or the interpreter for the runtime.
175
+ subprocess.check_call([uv, "venv", "--quiet", "--no-config", "--python", RUNTIME_PYTHON, prefix],
176
+ stdout=sys.stderr, cwd=home)
177
+ spec = os.environ.get(SPEC_ENV) or "%s==%s" % (DIST, version)
178
+ subprocess.check_call([uv, "pip", "install", "--quiet", "--no-config", "--python",
179
+ _bin(prefix, "python"), spec], stdout=sys.stderr, cwd=home)
180
+ if not os.path.exists(exe):
181
+ raise RuntimeError("%s is missing after the install" % exe)
182
+ open(ready, "w").close()
183
+ for name in os.listdir(home): # earlier releases' environments
184
+ old = os.path.join(home, name)
185
+ if name.startswith("py") and old != prefix and os.path.isdir(old):
186
+ shutil.rmtree(old, ignore_errors=True)
187
+ _say("Done -- next starts are immediate.")
188
+ return exe
189
+
190
+
191
+ def main():
192
+ if sys.version_info >= NATIVE:
193
+ import importlib
194
+ return getattr(importlib.import_module(ENTRY_MODULE), ENTRY_FUNC)()
195
+ try:
196
+ exe = runtime(_version())
197
+ except Exception as e:
198
+ _say("Could not set up %s on Python %s: %s\n"
199
+ "Install it with uv instead (it brings its own Python):\n"
200
+ " curl -LsSf https://astral.sh/uv/install.sh | sh && uv tool install %s"
201
+ % (DIST, RUNTIME_PYTHON, e, DIST))
202
+ sys.exit(1)
203
+ argv = [exe] + sys.argv[1:]
204
+ if _WINDOWS: # no exec on Windows: run it and pass its exit code on
205
+ sys.exit(subprocess.call(argv))
206
+ os.execv(exe, argv)
@@ -0,0 +1,181 @@
1
+ """The `webbee` command on any Python from 3.7 (webbee/_launch.py).
2
+
3
+ On 3.10+ it is webbee.cli.main itself; on 3.7-3.9 it runs the same release on a Python 3.12
4
+ set up once with uv. Real installs on 3.7/3.8/3.9 are checked in containers before a release;
5
+ these pin the decisions."""
6
+ import hashlib
7
+ import io
8
+ import os
9
+ import sys
10
+ import tarfile
11
+
12
+ import pytest
13
+
14
+ from webbee import _launch as L
15
+
16
+
17
+ def test_native_python_runs_the_cli_directly(monkeypatch):
18
+ called = []
19
+ import webbee.cli
20
+ monkeypatch.setattr(webbee.cli, "main", lambda: called.append("cli"))
21
+ monkeypatch.setattr(L, "runtime", lambda v: pytest.fail("no runtime on a native Python"))
22
+ L.main()
23
+ assert called == ["cli"]
24
+
25
+
26
+ def test_old_python_execs_the_runtime_with_the_same_arguments(monkeypatch):
27
+ monkeypatch.setattr(L, "NATIVE", (99, 0))
28
+ monkeypatch.setattr(L, "_WINDOWS", False)
29
+ monkeypatch.setattr(L, "runtime", lambda v: "/rt/bin/webbee")
30
+ monkeypatch.setattr(sys, "argv", ["webbee", "--marathon", "goal"])
31
+ seen = []
32
+ monkeypatch.setattr(os, "execv", lambda exe, argv: seen.append((exe, argv)))
33
+ L.main()
34
+ assert seen == [("/rt/bin/webbee", ["/rt/bin/webbee", "--marathon", "goal"])]
35
+
36
+
37
+ def test_a_failed_setup_says_how_to_install_and_exits_1(monkeypatch, capsys):
38
+ monkeypatch.setattr(L, "NATIVE", (99, 0))
39
+
40
+ def boom(v):
41
+ raise RuntimeError("no network")
42
+ monkeypatch.setattr(L, "runtime", boom)
43
+ with pytest.raises(SystemExit) as e:
44
+ L.main()
45
+ assert e.value.code == 1
46
+ err = capsys.readouterr().err
47
+ assert "no network" in err and "uv tool install webbee" in err
48
+
49
+
50
+ def test_a_ready_runtime_is_reused_without_uv(monkeypatch, tmp_path):
51
+ monkeypatch.setenv(L.HOME_ENV, str(tmp_path))
52
+ monkeypatch.setattr(L, "_WINDOWS", False)
53
+ prefix = tmp_path / ("py%s-1.2.3" % L.RUNTIME_PYTHON)
54
+ (prefix / "bin").mkdir(parents=True)
55
+ (prefix / "bin" / "webbee").write_text("")
56
+ (prefix / ".ready").write_text("")
57
+ monkeypatch.setattr(L, "_find_uv", lambda home: pytest.fail("a ready runtime needs no uv"))
58
+ assert L.runtime("1.2.3") == str(prefix / "bin" / "webbee")
59
+
60
+
61
+ def test_setup_installs_this_release_marks_it_ready_and_drops_older_ones(monkeypatch, tmp_path):
62
+ monkeypatch.setenv(L.HOME_ENV, str(tmp_path))
63
+ monkeypatch.delenv(L.SPEC_ENV, raising=False)
64
+ monkeypatch.setattr(L, "_WINDOWS", False)
65
+ (tmp_path / "py3.12-0.0.1").mkdir() # an earlier release's environment
66
+ monkeypatch.setattr(L, "_find_uv", lambda home: "/x/uv")
67
+ calls = []
68
+
69
+ def fake_call(cmd, **kw):
70
+ calls.append(cmd)
71
+ if cmd[1] == "venv":
72
+ os.makedirs(os.path.join(cmd[-1], "bin"))
73
+ else:
74
+ open(os.path.join(os.path.dirname(cmd[cmd.index("--python") + 1]), "webbee"), "w").close()
75
+ return 0
76
+ monkeypatch.setattr(L.subprocess, "check_call", fake_call)
77
+ exe = L.runtime("1.2.3")
78
+ prefix = tmp_path / "py3.12-1.2.3"
79
+ assert exe == str(prefix / "bin" / "webbee")
80
+ assert calls[0][:2] == ["/x/uv", "venv"] and L.RUNTIME_PYTHON in calls[0]
81
+ assert calls[1][-1] == "webbee==1.2.3" # the SAME release, never "latest"
82
+ assert (prefix / ".ready").exists()
83
+ assert not (tmp_path / "py3.12-0.0.1").exists()
84
+
85
+
86
+ def test_a_half_made_runtime_is_set_up_again(monkeypatch, tmp_path):
87
+ monkeypatch.setenv(L.HOME_ENV, str(tmp_path))
88
+ monkeypatch.setattr(L, "_WINDOWS", False)
89
+ prefix = tmp_path / "py3.12-1.2.3"
90
+ (prefix / "bin").mkdir(parents=True)
91
+ (prefix / "bin" / "webbee").write_text("") # no .ready: setup was interrupted
92
+ monkeypatch.setattr(L, "_find_uv", lambda home: "/x/uv")
93
+ calls = []
94
+
95
+ def fake_call(cmd, **kw):
96
+ calls.append(cmd[1])
97
+ if cmd[1] == "venv":
98
+ os.makedirs(os.path.join(cmd[-1], "bin"))
99
+ else:
100
+ open(os.path.join(os.path.dirname(cmd[cmd.index("--python") + 1]), "webbee"), "w").close()
101
+ return 0
102
+ monkeypatch.setattr(L.subprocess, "check_call", fake_call)
103
+ L.runtime("1.2.3")
104
+ assert calls == ["venv", "pip"]
105
+
106
+
107
+ @pytest.mark.parametrize("plat,machine,libc,want", [
108
+ ("linux", "x86_64", "glibc", "x86_64-unknown-linux-gnu"),
109
+ ("linux", "x86_64", "", "x86_64-unknown-linux-musl"),
110
+ ("linux", "aarch64", "glibc", "aarch64-unknown-linux-gnu"),
111
+ ("linux", "armv7l", "glibc", "armv7-unknown-linux-gnueabihf"),
112
+ ("darwin", "arm64", "", "aarch64-apple-darwin"),
113
+ ("darwin", "x86_64", "", "x86_64-apple-darwin"),
114
+ ])
115
+ def test_uv_build_for_the_machine(monkeypatch, plat, machine, libc, want):
116
+ monkeypatch.setattr(L.sys, "platform", plat)
117
+ monkeypatch.setattr(L, "_WINDOWS", False)
118
+ monkeypatch.setattr(L.platform, "machine", lambda: machine)
119
+ monkeypatch.setattr(L.platform, "libc_ver", lambda: (libc, ""))
120
+ assert L._uv_target() == want
121
+
122
+
123
+ def _uv_tarball():
124
+ buf = io.BytesIO()
125
+ with tarfile.open(fileobj=buf, mode="w:gz") as t:
126
+ body = b"#!/bin/sh\necho uv\n"
127
+ info = tarfile.TarInfo("uv-x86_64-unknown-linux-gnu/uv")
128
+ info.size = len(body)
129
+ t.addfile(info, io.BytesIO(body))
130
+ return buf.getvalue()
131
+
132
+
133
+ def test_uv_download_is_checked_and_unpacked(monkeypatch, tmp_path):
134
+ data = _uv_tarball()
135
+ monkeypatch.setattr(L, "_WINDOWS", False)
136
+ monkeypatch.setattr(L, "_uv_target", lambda: "x86_64-unknown-linux-gnu")
137
+ monkeypatch.setattr(L, "_fetch", lambda url: (hashlib.sha256(data).hexdigest() + " x").encode()
138
+ if url.endswith(".sha256") else data)
139
+ uv = L._install_uv(str(tmp_path))
140
+ assert uv == str(tmp_path / "uv" / "uv") and os.access(uv, os.X_OK)
141
+
142
+
143
+ def test_a_uv_download_that_does_not_match_its_checksum_is_refused(monkeypatch, tmp_path):
144
+ data = _uv_tarball()
145
+ monkeypatch.setattr(L, "_uv_target", lambda: "x86_64-unknown-linux-gnu")
146
+ monkeypatch.setattr(L, "_fetch", lambda url: b"0" * 64 if url.endswith(".sha256") else data)
147
+ with pytest.raises(RuntimeError, match="SHA-256"):
148
+ L._install_uv(str(tmp_path))
149
+ assert not (tmp_path / "uv" / "uv").exists()
150
+
151
+
152
+ def test_the_launcher_stays_python_37_syntax():
153
+ """It is the only module an old interpreter runs: no 3.8+ syntax (walrus, positional-only
154
+ parameters) and no annotations that need newer typing."""
155
+ import ast
156
+ src = open(L.__file__).read()
157
+ tree = ast.parse(src, feature_version=(3, 7))
158
+ assert not any(isinstance(n, ast.NamedExpr) for n in ast.walk(tree))
159
+ init = os.path.join(os.path.dirname(L.__file__), "__init__.py")
160
+ ast.parse(open(init).read(), feature_version=(3, 7))
161
+
162
+
163
+ def test_a_repository_config_cannot_steer_the_runtime_install(monkeypatch, tmp_path):
164
+ """Started inside someone's repository: its uv.toml / pyproject.toml / .python-version must not
165
+ choose the index or the interpreter -- uv runs with --no-config from the launcher's own folder."""
166
+ monkeypatch.setenv(L.HOME_ENV, str(tmp_path))
167
+ monkeypatch.setattr(L, "_WINDOWS", False)
168
+ monkeypatch.setattr(L, "_find_uv", lambda home: "/x/uv")
169
+ seen = []
170
+
171
+ def fake_call(cmd, **kw):
172
+ seen.append((cmd, kw.get("cwd")))
173
+ if cmd[1] == "venv":
174
+ os.makedirs(os.path.join(cmd[-1], "bin"))
175
+ else:
176
+ open(os.path.join(os.path.dirname(cmd[cmd.index("--python") + 1]), "webbee"), "w").close()
177
+ return 0
178
+ monkeypatch.setattr(L.subprocess, "check_call", fake_call)
179
+ L.runtime("1.2.3")
180
+ assert len(seen) == 2
181
+ assert all("--no-config" in cmd and cwd == str(tmp_path) for cmd, cwd in seen)
@@ -1 +0,0 @@
1
- __version__ = "0.5.5"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes