Skip to content

omip: install OmniPython packages from the computer, with what they need - #207

Open
bdbarnett wants to merge 1 commit into
mainfrom
omip-host
Open

bdbarnett wants to merge 1 commit into
mainfrom
omip-host

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

mpftp omip NAME installs an OmniPython package and what it needs, from the computer, so the board needs no network. It looks on the OmniPython index, then micropython-lib, then follows the package's upstream key to micropython-lib, the same order omip uses on a board. mpftp omip --self copies omip.py on, on CircuitPython as well, through the drive when it's mounted. Naming a package on CircuitPython is refused and points at mpftp circup. mpftp mip still means what it meant, and a test pins that it ignores upstream.

It's a new command because mip is one index and no more. Everything downloads before the first write, so a package or a file that can't be had leaves the board as it was. The editor and the browser interface still offer mip and circup; that's a roadmap line.

To check it, cli/tests/test_omip.py runs the real session and mpremote's helpers against real HTTP servers, with a folder standing in for the board. Four planted faults each fail it: upstream ignored, upstream looked up on the wrong index, the lookup order swapped, and writing before the downloads finish. I also ran the command itself on real MicroPython, the unix build answering a small raw REPL on a pseudo terminal, against a local build of the index that carries upstream, with micropython.org as the real upstream. mpftp omip bledev landed 15 bledev files and 9 aioble files, and import aioble worked with a stand-in bluetooth module, which the unix build doesn't have. mpftp mip bledev from the same index landed the 15 and no aioble. mpftp omip --self fetched from GitHub and import omip worked. A missing package exits 1 and names both indexes.

Not verified: a real board over USB or Wi-Fi, and CircuitPython beyond the unit tests, which use a temporary folder for the drive and a fake serial transport.

mip takes every file from the one index it's given and ignores a package's
upstream key, so a package on the OmniPython index can't bring what it needs
from micropython-lib. A board with no network can't run omip on itself.

mpftp omip NAME does the same walk from the host: ours, then micropython-lib,
then whatever the package names under upstream. Everything downloads before
the first write. mpftp omip --self copies omip.py on, on CircuitPython too,
where named packages stay with circup. mpftp mip means what it meant.

Ran cli/tests/test_omip.py, and the command itself against real MicroPython on
a pseudo terminal. No real board was run.

This branch has not been deployed

No deployments
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