Skip to content

Commit 4f31d52

Browse files
committed
merge(development→main): uv-ffi post10 vendor update, submodule bump, __init__ cleanup
- Bump uv-ffi submodule to post10 (auto-heal stale site-packages cache) - Clean vendor __init__.py: try/except import, remove duplicate clear_registry_cache - Add __all__ for explicit public API surface - Pin uv_ffi>=0.10.8.post4 in pyproject.toml (relaxed floor, post10 installed) - Bump _uv_ffi_min fallback in core.py to post2 - Update piwheels stats and platform matrix - Bump requirements.txt/requirements-trace.txt to post4
2 parents fe6525a + 9f07b70 commit 4f31d52

9 files changed

Lines changed: 56 additions & 62 deletions

File tree

.github/piwheels-stats.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
<!-- PIWHEELS_STATS_START -->
22
## 🥧 ARM32 Support (Raspberry Pi)
3-
43
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
5-
6-
**Latest Version:** `2.0.8.1` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
7-
4+
**Latest Version:** `3.0.0` | **Python:** 3.9 (Bullseye), 3.11 (Bookworm), 3.13 (Trixie) | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
85
```bash
9-
# Install on Raspberry Pi (ARM32)
10-
pip3 install omnipkg==2.0.8.1
6+
pip3 install omnipkg==3.0.0
117
```
12-
138
**Verified Platforms:**
14-
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye (Debian 11), Bookworm (Debian 12), Trixie (Debian 13)
15-
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-2.0.8.1-py3-none-any.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-2.0.8.1-py3-none-any.whl)
16-
9+
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye, Bookworm, Trixie
10+
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.0.0-cp311-cp311-linux_armv7l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.0.0-cp311-cp311-linux_armv7l.whl)
1711
<!-- PIWHEELS_STATS_END -->

.github/platform-matrix.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"arm32": {
33
"verified": true,
4-
"version": "2.0.8.1",
5-
"python_versions": "",
6-
"install_command": "pip3 install omnipkg==2.0.8.1",
4+
"version": "3.0.0",
5+
"python_versions": "3.9 (Bullseye), 3.11 (Bookworm), 3.13 (Trixie)",
6+
"cp39_bullseye": true,
7+
"cp311_bookworm": true,
8+
"cp313_trixie": true,
9+
"install_command": "pip3 install omnipkg==3.0.0",
710
"platforms": ["Raspberry Pi", "Raspbian Bullseye", "Raspbian Bookworm", "Raspbian Trixie"]
811
}
912
}

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,27 +1403,28 @@ brew install omnipkg
14031403

14041404
#### 🥧 piwheels (for Raspberry Pi)
14051405
<!-- PIWHEELS_STATS_START -->
1406-
14071406
## 🥧 ARM32 Support (Raspberry Pi)
14081407
[![piwheels](https://img.shields.io/badge/piwheels-ARM32%20verified-97BF0D?logo=raspberrypi&logoColor=white)](https://www.piwheels.org/project/omnipkg/)
1409-
1410-
**Latest Version:** `2.0.8.1` | **Python:** | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
1411-
1408+
**Latest Version:** `3.0.0` | **Python:** 3.9 (Bullseye), 3.11 (Bookworm), 3.13 (Trixie) | [View on piwheels](https://www.piwheels.org/project/omnipkg/)
14121409
```bash
1413-
# Install on Raspberry Pi (ARM32)
1414-
pip3 install omnipkg==2.0.8.1
1410+
pip3 install omnipkg==3.0.0
14151411
```
1416-
14171412
**Verified Platforms:**
1418-
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye (Debian 11), Bookworm (Debian 12), Trixie (Debian 13)
1419-
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-2.0.8.1-py3-none-any.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-2.0.8.1-py3-none-any.whl)
1420-
1413+
- 🍓 Raspberry Pi (armv6/armv7) - Bullseye, Bookworm, Trixie
1414+
- 📦 Wheel: [`https://www.piwheels.org/simple/omnipkg/omnipkg-3.0.0-cp311-cp311-linux_armv7l.whl`](https://www.piwheels.org/simple/omnipkg/omnipkg-3.0.0-cp311-cp311-linux_armv7l.whl)
14211415
<!-- PIWHEELS_STATS_END -->
14221416

14231417

14241418

14251419

14261420

1421+
1422+
1423+
1424+
1425+
1426+
1427+
14271428
<a href="https://www.piwheels.org/project/omnipkg/">
14281429
<img src="https://img.shields.io/badge/piwheels-install-97BF0D?logo=raspberrypi&logoColor=white" alt="piwheels Install">
14291430
</a>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ classifiers = [
3939
]
4040

4141
dependencies = [
42-
"uv_ffi>=0.10.8.post4 ; python_version >= '3.8' and python_version <= '3.14'",
42+
"uv_ffi>=0.10.8.post7 ; python_version >= '3.8' and python_version <= '3.14'",
4343
"requests>=2.20",
4444
"psutil>=5.9.0",
4545
"typer>=0.4.0",

requirements-trace.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ urllib3==2.6.3 ; python_version >= "3.10"
142142
# requests
143143
uv==0.10.11 ; python_version >= "3.8"
144144
# via omnipkg (pyproject.toml)
145-
uv-ffi==0.10.8.post4 ; python_version >= "3.8" and python_version <= "3.14"
145+
uv-ffi==0.10.8.post7 ; python_version >= "3.8" and python_version <= "3.14"
146146
# via omnipkg (pyproject.toml)
147147
werkzeug==3.1.6 ; python_version >= "3.9"
148148
# via

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typer==0.24.1
5555
typing-extensions==4.15.0
5656
urllib3==2.6.3 ; python_version >= "3.10"
5757
uv==0.10.11 ; python_version >= "3.8"
58-
uv-ffi==0.10.8.post4 ; python_version >= "3.8" and python_version <= "3.14"
58+
uv-ffi==0.10.8.post7 ; python_version >= "3.8" and python_version <= "3.14"
5959
werkzeug==3.1.6 ; python_version >= "3.9"
6060
yarl==1.23.0
6161

src/omnipkg/_vendor/uv_ffi/__init__.py

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,30 @@
55
removed: list of (name, version) tuples
66
err: error string (empty on success)
77
"""
8-
import os as _os
9-
import sys as _sys
10-
_sys.path.insert(0, _os.path.join(_os.path.dirname(__file__), '_native'))
11-
from uv_ffi import run as _run_native
8+
try:
9+
# Prefer the properly installed wheel
10+
from uv_ffi.uv_ffi import (
11+
run as _run_native,
12+
get_site_packages_cache,
13+
invalidate_site_packages_cache,
14+
patch_site_packages_cache,
15+
clear_registry_cache,
16+
)
17+
except ImportError:
18+
# Fall back to vendored .so
19+
import os as _os, sys as _sys
20+
_sys.path.insert(0, _os.path.join(_os.path.dirname(__file__), '_native'))
21+
from uv_ffi import (
22+
run as _run_native,
23+
get_site_packages_cache,
24+
invalidate_site_packages_cache,
25+
patch_site_packages_cache,
26+
clear_registry_cache,
27+
)
1228

1329
def run(cmd: str) -> tuple:
1430
"""Call uv FFI directly — returns (rc, installed, removed, err).
15-
Gracefully handles old 3-tuple .so builds by padding err='' ."""
31+
Gracefully handles old 3-tuple .so builds by padding err=''."""
1632
result = _run_native(cmd)
1733
if len(result) == 3:
1834
return (result[0], result[1], result[2], '')
@@ -26,32 +42,12 @@ def run(cmd: str) -> tuple:
2642
except Exception:
2743
__version__ = "unknown"
2844

29-
# ── Optional exports: present only if the .so was built with them ────────────
30-
# Imported lazily so that an older .so without these functions doesn't cause
31-
# an ImportError on the whole module and break FFI availability detection.
32-
33-
def _try_import(name: str):
34-
try:
35-
import uv_ffi as _m
36-
return getattr(_m, name)
37-
except (ImportError, AttributeError):
38-
return None
39-
40-
_invalidate = _try_import('invalidate_site_packages_cache')
41-
if _invalidate is not None:
42-
invalidate_site_packages_cache = _invalidate
43-
44-
_patch = _try_import('patch_site_packages_cache')
45-
if _patch is not None:
46-
patch_site_packages_cache = _patch
47-
_gspc = _try_import('get_site_packages_cache')
48-
if _gspc is not None:
49-
get_site_packages_cache = _gspc
50-
51-
_clear_reg = _try_import('clear_registry_cache')
52-
if _clear_reg is not None:
53-
clear_registry_cache = _clear_reg
54-
55-
_clear_reg = _try_import('clear_registry_cache')
56-
if _clear_reg is not None:
57-
clear_registry_cache = _clear_reg
45+
__all__ = [
46+
"run",
47+
"run_capture",
48+
"get_site_packages_cache",
49+
"invalidate_site_packages_cache",
50+
"patch_site_packages_cache",
51+
"clear_registry_cache",
52+
"__version__",
53+
]

src/omnipkg/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7120,7 +7120,7 @@ def sync_interpreter(py_ver, target_exe):
71207120
else:
71217121
return (py_ver, False)
71227122
# Read uv_ffi min version from pyproject.toml once, in main process
7123-
_uv_ffi_min = "0.10.8.post2" # fallback
7123+
_uv_ffi_min = "0.10.8.post7" # fallback
71247124
try:
71257125
import tomllib as _toml
71267126
except ImportError:

0 commit comments

Comments
 (0)