Metadata-Version: 2.1
Name: openmv-runtime
Version: 0.3.0
Summary: OpenMV runtime extension modules for Python
Author: SingTown LLC
Requires-Python: >=3.9
Requires-Dist: numpy>=2.0.2
Requires-Dist: pyserial>=3.5
Requires-Dist: ai-edge-litert>=2.0.2; sys_platform != "darwin" or platform_machine == "arm64"
Requires-Dist: dbus-fast>=2.21
Description-Content-Type: text/markdown

# Prepare Linux

- Mac OS

```
brew install orbstack
orb
```

- Windows

```
wsl
```

# Prepare Tool

```
sudo apt update
sudo apt install -y git ca-certificates curl build-essential cmake python3-dev
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -fsSL https://claude.ai/install.sh | bash
```

# Develop

```
uv sync -v
uv pip install -e . --no-build-isolation -v
```

# Build wheel

```
curl -fsSL https://get.docker.com | sh && sudo usermod -aG docker $USER && newgrp docker
docker run --privileged --rm tonistiigi/binfmt --install all

export CIBW_PLATFORM=linux
export CIBW_BUILD="cp312-manylinux_aarch64"
uvx cibuildwheel . --archs aarch64
```

The combined wheel is published as the `openmv-runtime` distribution. After
`pip install openmv-runtime`, the runtime modules are still imported as top-level
modules. All platforms provide:

```
import image
import gif
import mjpeg
import ml
```

Linux builds also provide the hardware modules:

```
import sensor
import imu
import machine
```

Linux boards with BlueZ also get BLE in the MicroPython `aioble` style (the
peripheral role: GATT server and advertising), plus a tiny `micropython`
shim so firmware examples that use `const()` run unchanged:

```
import bluetooth   # bluetooth.UUID
import aioble      # aioble.Service, Characteristic, register_services, advertise
import micropython # micropython.const
```

The firmware examples under `scripts/examples/10-Bluetooth/` run as-is except
for `asyncio.sleep_ms(x)`, which CPython spells `asyncio.sleep(x / 1000)`.

Use OrbStack as the Docker backend for final wheel validation.

## Test

```
uv run pytest
```
