Skip to content

Package manager: put omip.py on the connected device from the Tools menu - #37

Merged
bdbarnett merged 1 commit into
mainfrom
omip-menu
Nov 5, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
omip-menu

Conversation

@bdbarnett

Copy link
Copy Markdown

A board that can reach the network installs OmniPython packages with omip.py. Tools > Install omip.py on the device gets that one file onto whatever is connected, so nobody has to type a URL at a prompt. Then import omip; omip.install("package") works on the device.

It goes through rawInstallPkg with the package described up front, so it doesn't depend on any index being reachable. It stays source: CircuitPython can't run the .mpy this app would compile, and the same file then works everywhere. The new code is in src/pydevices/omip.js; app.js gains a small seam in installPkg.

To check it, I built with python3 build.py --skip-tests and ran omip.spec.js and packages.spec.js in Chromium: all four pass. The spec fetches the real file from GitHub, writes it to the simulator, imports it from /lib/omip.py, and sees no request to any index. A 404 reports the failure and writes nothing, and with nothing connected it asks for a device. Two planted faults each fail the first test: installing as .mpy, and dropping the up-front description. By hand in the simulator, omip.install("fnmatch") then ran and installed from micropython-lib.

Not verified: a real board. A headless browser can't open WebSerial, so a USB board is untested, and that includes CircuitPython, which is why the source-only choice hasn't been seen running there.

A board that can reach the network installs OmniPython packages with
omip.py, and this gets that one file onto it without typing a URL. It goes
through the same install as every other package, so it reaches a USB,
Bluetooth or network board and the simulator alike. It stays source, because
CircuitPython can't run the .mpy this app would compile, and it needs no
package index.

test/browser/omip.spec.js fetches the real file in Chromium, writes it to the
simulator and imports it. WebSerial can't be opened in a headless browser, so
a real board wasn't run.
@bdbarnett
bdbarnett merged commit 2eae42a into main Nov 5, 2026
1 check passed
@bdbarnett
bdbarnett deleted the omip-menu branch November 5, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant