Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Thenimport omip; omip.install("package")works on the device.It goes through
rawInstallPkgwith the package described up front, so it doesn't depend on any index being reachable. It stays source: CircuitPython can't run the.mpythis app would compile, and the same file then works everywhere. The new code is insrc/pydevices/omip.js;app.jsgains a small seam ininstallPkg.To check it, I built with
python3 build.py --skip-testsand ranomip.spec.jsandpackages.spec.jsin 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.