Skip to content

Commit 8eb50cf

Browse files
committed
Merge development into main: daemon IPC, installer refactor, i18n, and uv-ffi healing
✨ Features: * feat(i18n): per-language help routing and fast-path string micro-optimizations (8ef5cf2) - Implement is_help_flag and is_version_flag in the C dispatcher using uint64_t word loads to optimize string comparison for '--help' and '--version' flags. - Check for a lightweight marker file (~/.config/omnipkg/lang_marker_en) in both the C dispatcher and dispatcher.py to decide when to instantly serve the baked English help text. - Fall back to Python argparse for non-English locales to correctly serve fully translated subcommand lists and argument menus. - Restore translated argument descriptions (removed argparse.SUPPRESS) across all subcommands so localized menus render properly on fallback. - Update .bashrc and .zshrc with OMNIPKG_LANG when the language is changed via the config menu to keep settings persistent. - Ensure i18n.py and worker_daemon.py read the config file directly during early initialization so language variables are set before ConfigManager starts. Modified: • src/omnipkg/cli.py (+296/-216 lines) • src/omnipkg/dispatcher.c (+44/-8 lines) • src/omnipkg/dispatcher.py (+11/-3 lines) • src/omnipkg/i18n.py (+11/-1 lines) • src/omnipkg/isolation/worker_daemon.py (+7/-1 lines) * feat(daemon): add Torch MP Queue IPC fallback and interactive idle policy (290da0e) - Implemented fallback for Turing/CUDA 13 GPUs where is broken. - now correctly uses for true zero-copy. - Upgraded resource monitor with interactive TUI (, ). - Users can now configure persistent idle-worker policies directly from the CLI. * feat(abi): implement ELF parsing for NumPy C-API resolution (11a4500) - now parses ELF sections to extract . - Added and to the Knowledge Base. - Loader now injects correct NumPy ABI bubble paths before PyTorch/TensorFlow initialization. - Added injection to sterile environments to fix Torch import verification. * refactor(core): decouple installers and implement atomic stash-swaps (2c9a2fd) - Extracted monolithic install logic into and . - Implemented staircase dispatch: FFI → Daemon IPC → subprocess uv → pip. - Added : atomically renames current packages to protect them during uv installs, eliminating the need to rebuild bubbles from scratch. - Updated contract to support atomic plan callback interception. * feat(cli): implement zero-overhead help system and C-dispatcher fast paths (eae5bcb) - Extracted help text into and compiled directly into . - C dispatcher now intercepts and instantly (0ms startup). - Refactored to use normalized arguments and pre-rendered help strings. - Added utility and normalized handling. 🐛 Fixes: * fix: fix safe print usage in dispatcher.py (8dc66ab) Modified: • src/omnipkg/dispatcher.py (+104/-104 lines) * fix: resolve translation shadowing, standardize safe_print, and refactor tests (d5b0642) - Replaced tuple unpacking dummy variables (`_`) with `unused` globally to prevent shadowing the `_` gettext translation function. - Swapped standard `print()` calls for `safe_print()` in the core, dispatcher, and tests to prevent UnicodeEncodeErrors on strict terminals and Windows. - Refactored `test_verify_bubble_deps.py` into an OOP `KBSyncVerifier` class with bi-directional (DB ↔ Disk) symmetry checks. - Relocated FFI and diagnostic tests (`diag_uv_ffi.py`, `test_uv_ffi_contracts.py`) to the root `tests/` directory and fixed linter-induced AttributeErrors. - Added the "Daemon IPC Showcase" (Option 11) to the interactive `8pkg demo` CLI menu. - Enhanced the daemon worker pre-warm logic to accurately detect and strip framework (torch/tensorflow) site-packages from the bubble path. - Registered the `integration` pytest marker in `pytest.ini`. New files: • tests/diag_uv_ffi.py (425 lines) • tests/test_uv_ffi_contracts.py (793 lines) Modified: • build_hooks.py (+1/-1 lines) • src/omnipkg/cli.py (+4/-2 lines) • src/omnipkg/core.py (+2/-2 lines) • src/omnipkg/dispatcher.py (+34/-34 lines) • src/omnipkg/installation/installers.py (+4/-4 lines) • src/omnipkg/installation/smart_install.py (+3/-3 lines) • src/omnipkg/integration/reproducible.py (+44/-40 lines) • src/omnipkg/isolation/fs_lock_queue.py (+1/-1 lines) • src/omnipkg/isolation/fs_watcher.py (+7/-7 lines) • src/omnipkg/isolation/resource_monitor.py (+7/-7 lines) • src/omnipkg/isolation/worker_daemon.py (+17/-4 lines) • src/omnipkg/package_meta_builder.py (+10/-10 lines) • src/omnipkg/windows_bootstrap/launcher.py (+1/-1 lines) • setup.py (+4/-4 lines) • pytest.ini (+1/-0 lines) • src/omnipkg/tests/omnipkg_ipc_showcase.py (+22/-17 lines) • src/omnipkg/tests/test_concurrent_install.py (+2/-2 lines) • src/omnipkg/tests/test_daemon_tags.py (+22/-18 lines) • src/omnipkg/tests/test_loader_stress_test.py (+1/-1 lines) • src/omnipkg/tests/test_old_rich.py (+1/-1 lines) • src/omnipkg/tests/test_rich_switching.py (+3/-3 lines) • src/omnipkg/tests/test_tensorflow_switching.py (+1/-1 lines) • tests/test_dispatcher_contracts.py (+1/-1 lines) • tests/test_ffi_verify.py (+13/-9 lines) • tests/test_flask_port_finder.py (+9/-9 lines) • tests/test_omnipkg_contracts.py (+11/-11 lines) • tests/test_verify_bubble_deps.py (+117/-179 lines) * fix(windows): guard fcntl usage behind platform checks (5855d88) - core.py: lazy import now branches to msvcrt on win32 - smart_install.py: _BubbleLock uses msvcrt.locking on win32, fcntl on POSIX - Fixes 'Missing standard library module fcntl' crash on Windows CI * fix(heal): target ghost repair directly to main environment (9b1a1c0) - now checks physical site-packages paths, bypassing bubble pollution. - now forces strategy during repair. - Fixes bug where healed packages were bubbled while broken metadata was restored to main. 📚 Documentation: * docs: update ARM32 piwheels stats for v3.3.5 [skip ci] (x8) * docs: update ARM32 piwheels stats for v3.3.4 [skip ci] (866196c) 🧪 Tests: * test: add IPC showcase and FFI contract diagnostics (c4e98cd) - Added to demonstrate the 'Impossible Pipeline' (zero-copy GPU IPC across Python 3.9/3.10/3.11). - Added to validate stale-dir and ghost-eviction logic. - Added to lock in FFI expected behaviors. - Updated to track planned install files. 📝 Other changes: * Update 1 code files (x2) * Modify omnipkg info commands for non-interactive mode (5c84b32) Updated omnipkg info command to use non-interactive mode for final state verification and TensorFlow import testing. 📊 47 files changed, 9289 insertions(+), 4311 deletions(-) 📁 Detailed file changes: Source code: • src/omnipkg/core.py: +617 -2044 • src/omnipkg/installation/smart_install.py: +1305 -1148 • src/omnipkg/cli.py: +853 -219 • src/omnipkg/installation/installers.py: +805 • src/omnipkg/isolation/worker_daemon.py: +535 -118 • src/omnipkg/help.toml: +440 • src/omnipkg/isolation/resource_monitor.py: +348 -84 • src/omnipkg/_help.h: +354 • src/omnipkg/_help.py: +336 • src/omnipkg/dispatcher.c: +229 -28 • src/omnipkg/_vendor/uv_ffi/__init__.py: +204 -46 • src/omnipkg/dispatcher.py: +144 -106 • src/omnipkg/commands/run.py: +162 -25 • src/omnipkg/integration/reproducible.py: +58 -47 • src/omnipkg/common_utils.py: +41 • src/omnipkg/installation/verification_strategy.py: +18 • src/omnipkg/loader.py: +15 -1 • src/omnipkg/isolation/fs_watcher.py: +7 -7 • src/omnipkg/i18n.py: +11 -1 • src/omnipkg/isolation/patchers.py: +7 • src/omnipkg/_vendor/uv: +1 -1 • src/omnipkg/isolation/fs_lock_queue.py: +1 -1 • src/omnipkg/windows_bootstrap/launcher.py: +1 -1 Tests: • src/omnipkg/tests/omnipkg_ipc_showcase.py: +1002 • tests/test_uv_ffi_contracts.py: +793 • tests/diag_uv_ffi.py: +425 • tests/test_verify_bubble_deps.py: +117 -179 • tests/test_verify_bubble_deps2.py: -127 • src/omnipkg/tests/test_loader_stress_test.py: +57 -15 • src/omnipkg/tests/test_daemon_tags.py: +22 -18 • tests/test_ffi_verify.py: +13 -9 • tests/test_omnipkg_contracts.py: +11 -11 • tests/test_flask_port_finder.py: +9 -9 • src/omnipkg/tests/test_tensorflow_switching.py: +11 -6 • src/omnipkg/tests/test_rich_switching.py: +3 -3 • src/omnipkg/tests/test_concurrent_install.py: +2 -2 • src/omnipkg/tests/test_old_rich.py: +1 -1 • tests/test_dispatcher_contracts.py: +1 -1 • pytest.ini: +1 Documentation: • README.md: +12 -3 • .github/piwheels-stats.md: +3 -3 Configuration: • src/omnipkg/package_meta_builder.py: +299 -34 • .github/workflows/cross_interpreter_installs.yml: +7 -6 • setup.py: +4 -4 Other: • .github/platform-matrix.json: +2 -2 • build_hooks.py: +1 -1 • .gitignore: +1 Commits: 0e15c2f..808b0f6
2 parents 0e15c2f + 808b0f6 commit 8eb50cf

47 files changed

Lines changed: 9289 additions & 4311 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/piwheels-stats.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!-- PIWHEELS_STATS_START -->
22
## 🥧 ARM32 Support (Raspberry Pi)
33
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
4-
**Latest Version:** `3.3.4` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
4+
**Latest Version:** `3.3.5` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
55
```bash
6-
pip3 install omnipkg==3.3.4
6+
pip3 install omnipkg==3.3.5
77
```
88
**Verified Platforms:**
99
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye, Bookworm, Trixie
10-
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.4-cp37-abi3-linux_armv6l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.4-cp37-abi3-linux_armv6l.whl)
10+
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.5-cp37-abi3-linux_armv6l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.5-cp37-abi3-linux_armv6l.whl)
1111
<!-- PIWHEELS_STATS_END -->

.github/platform-matrix.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"arm32": {
33
"verified": true,
4-
"version": "3.3.4",
4+
"version": "3.3.5",
55
"python_versions": "",
66
"cp39_bullseye": false,
77
"cp311_bookworm": false,
88
"cp313_trixie": false,
9-
"install_command": "pip3 install omnipkg==3.3.4",
9+
"install_command": "pip3 install omnipkg==3.3.5",
1010
"platforms": ["Raspberry Pi", "Raspbian Bullseye", "Raspbian Bookworm", "Raspbian Trixie"]
1111
}
1212
}

.github/workflows/cross_interpreter_installs.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,10 @@ jobs:
119119
fi
120120
121121
- name: Verify Final State
122+
env:
123+
OMNIPKG_NONINTERACTIVE: "1"
122124
run: |
123-
echo "--- Verifying final state ---"
124-
FINAL_INFO=$(omnipkg info python 2>/dev/null)
125-
echo "Final Python info:"
126-
echo "$FINAL_INFO"
125+
FINAL_INFO=$(omnipkg info python -y 2>/dev/null)
127126
128127
if echo "$FINAL_INFO" | grep -q "Active Context:.*3.13" || \
129128
echo "$FINAL_INFO" | grep -q "Python 3.13.*currently active"; then
@@ -147,10 +146,12 @@ jobs:
147146
echo '```' >> $GITHUB_STEP_SUMMARY
148147
149148
- name: Test TensorFlow Import on Python 3.13
149+
env:
150+
OMNIPKG_NONINTERACTIVE: "1"
150151
run: |
151152
echo "--- Testing TensorFlow import ---"
152-
PYTHON_INFO=$(omnipkg info python 2>/dev/null)
153-
PYTHON_313_EXE=$(echo "$PYTHON_INFO" | grep 'Python 3.13:' | awk '{print $4}' || echo "")
153+
PYTHON_INFO=$(omnipkg info python -y 2>/dev/null)
154+
PYTHON_313_EXE=$(echo "$PYTHON_INFO" | grep '3.13' | awk '{print $NF}')
154155
155156
if [ -n "$PYTHON_313_EXE" ]; then
156157
echo "Testing TensorFlow import on Python 3.13..."

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,4 @@ build/
214214
__pycache__/
215215
*.pyc
216216
*.pyo
217+
src/omnipkg/installation/*_planned.py

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,13 +1405,13 @@ brew install omnipkg
14051405
<!-- PIWHEELS_STATS_START -->
14061406
## 🥧 ARM32 Support (Raspberry Pi)
14071407
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
1408-
**Latest Version:** `3.3.4` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
1408+
**Latest Version:** `3.3.5` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
14091409
```bash
1410-
pip3 install omnipkg==3.3.4
1410+
pip3 install omnipkg==3.3.5
14111411
```
14121412
**Verified Platforms:**
14131413
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye, Bookworm, Trixie
1414-
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.4-cp37-abi3-linux_armv6l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.4-cp37-abi3-linux_armv6l.whl)
1414+
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.5-cp37-abi3-linux_armv6l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.3.5-cp37-abi3-linux_armv6l.whl)
14151415
<!-- PIWHEELS_STATS_END -->
14161416

14171417

@@ -1439,6 +1439,15 @@ pip3 install omnipkg==3.3.4
14391439

14401440

14411441

1442+
1443+
1444+
1445+
1446+
1447+
1448+
1449+
1450+
14421451

14431452

14441453

build_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _collect_host_info() -> dict:
101101
fields = {}
102102
for line in Path(osr).read_text().splitlines():
103103
if "=" in line and not line.startswith("#"):
104-
k, _, v = line.partition("=")
104+
k, unused, v = line.partition("=")
105105
fields[k.strip()] = v.strip().strip('"')
106106
info["linux_distro_id"] = fields.get("ID", "unknown").lower()
107107
info["linux_distro_version"] = fields.get("VERSION_ID", "unknown")

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
addopts = -ra --color=yes --continue-on-collection-errors
33
markers =
44
windows_compat: Tests that verify Windows-specific compatibility
5+
integration: marks tests as integration tests (deselect with '-m "not integration"')

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _skip(reason, **kw): return {"status": "skipped", "reason": reason, **kw}
160160

161161
if replaced:
162162
binary_out.unlink(missing_ok=True)
163-
print(f" [dispatcher] ✅ Fast C dispatcher installed over: {replaced}")
163+
safe_print(f" [dispatcher] ✅ Fast C dispatcher installed over: {replaced}")
164164
installed_paths = []
165165
for name in replaced:
166166
target = Path(install_dir) / (name + _exe)
@@ -276,7 +276,7 @@ def _clean_env():
276276
import importlib.util, site
277277
sp = site.getsitepackages()
278278
sp0 = sp[0] if sp else "unknown"
279-
print(" [uv-ffi] ✅ PyO3 FFI extension built and installed")
279+
safe_print(" [uv-ffi] ✅ PyO3 FFI extension built and installed")
280280
print(f" [uv-ffi] site-packages : {sp0}")
281281
# Find the actual .so path for the manifest
282282
import glob as _uvg
@@ -375,7 +375,7 @@ def _collect_host_info() -> dict:
375375
fields = {}
376376
for line in Path(osr).read_text().splitlines():
377377
if "=" in line and not line.startswith("#"):
378-
k, _, v = line.partition("=")
378+
k, unused, v = line.partition("=")
379379
fields[k.strip()] = v.strip().strip('"')
380380
info["linux_distro_id"] = fields.get("ID", "unknown").lower()
381381
info["linux_distro_version"] = fields.get("VERSION_ID", "unknown")
@@ -672,7 +672,7 @@ def build_extension(self, ext):
672672
print(f" [atomic] output (.so) : {Path(so_path).resolve()}")
673673
try:
674674
super().build_extension(ext)
675-
print(f" [atomic] ✅ built to : {Path(so_path).resolve()}")
675+
safe_print(f" [atomic] ✅ built to : {Path(so_path).resolve()}")
676676
self._atomic_result = {"status": "ok", "so_path": str(Path(so_path).resolve())}
677677
except Exception as e:
678678
print(f"\n{'!'*60}")

0 commit comments

Comments
 (0)