-
Notifications
You must be signed in to change notification settings - Fork 1k
Scope of micropython-lib
#578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I personally think it's a bit of a blurry line between considering micropython-lib as more like PyPI or the python standard library.
There's been a few discussions about this lately wrapped up in the manifest and mip development; my understanding is that user submissions of libraries and drivers are ,very welcome and encouraged, however they're still going to need to go through the same PR / code review process as everything else here which is going to slow down the ability for people to release their own code at their own pace, with the trade-off being hopefully higher standards and quality of code released. Alternatively there's a plan to be able to directly specify your own GitHub repo (with same structure as individual packages here) in manifests / mip to directly release your own libraries without them going via here - this is more like the PyPI alternative.
This is certainly a complicated topic. I can see there's going to be need to declare compatibility for particular packages in some way; certainly dynamic native module for instance will often only support a subset of ports, and even plenty of pure python ones may use chip specific features like the Pico PIO. However I don't know that board compatibility makes sense? Most libraries / drivers should work on any board on a compatible port & hardware? If we're taking about board specific code that configures other drivers etc that should live in the board folder (in micropython repo) rather than here. |
Thanks @roaldarbol great question.
Yes. Absolutely. I made a first step PR last week to start updating the README etc to make some of this more clear. #576 Some extra historical context: #506 (and significantly more discussion at the companion main-repo PR here: micropython/micropython#8914 ). There are some examples there of other scenarios we want to support. One feature in particular is the mpremote support for using manifests directly (i.e. "app manifests"). Also linking this to the "mapfs" feature (micropython/micropython#8381) which allows "dynamic freezing" (i.e. all the benefits of freezing without haivng to recompile or re-deploy the firmware). See for example the results I posted here micropython/micropython#8426 (comment) -- you can deploy entire large app as a mapfs in 3 seconds. In the process that led to writing
This hasn't been widely advertised, but we also publish an index.json of all micropython-lib packages at https://micropython.org/pi/v2/index.json
Yes! There are two main parts to this.
We don't currently support this, but I'm working on it at the moment. See miguelgrinberg/microdot#67 for a conversation I had with the (I haven't quite figured out all the details, but the idea is that we want to support third-party repos for on-device, mpremote, and freezing as if they were "first-party", with as little burden on the package maintainer as possible, e.g. to push new versions etc).
This is all slightly more complicated. The Pimoroni case in particular where they want to not only freeze Python code, but also a lot of extra C code. This is definitely on our radar, and we're seeing this across multiple vendors (of various sizes!), and if we're going to be the official source of board firmware, then we need to support it.
mip (and the related supporting infrastructure) lets packages define a version. When you install a package you can optionally specify a version (and implicity the bytecode version of the device you're installing to). Packages bundle their dependencies, so you always get dependencies at the version that matches the desired package. Installing "latest" (default) gets you the latest of all dependencies. Note that we expressly do not support the scenario where two packages, A, B, depend on different versions of the same shared dependency, C -- you will end up with C at whichever version was pulled in by whichever of A and B you installed most recently. i.e. this means that installing B can break A if it downgrades C. (Yes, this is very simplistic, and there are lots of incremental improvements we can make by adding varying levels of extra metadata onto the board during the installation process).
This is also on our radar. I'm not terribly keen on having packages list boards specifically, but definitely having a way to say "will this package run on my device" is important. i.e. some sort of GUI tool should be able to just show packages that will work on the currently connected device. The other side of this is generally defining a set of "compatible" APIs that packages can use and then expect to work on "most" devices. Happy to discuss more here, and also on discord -- https://micropython.org/discord |
Hi there!
This is more of a discussion thread, not an issue. I'm coming in quite fresh, so I do apologise for where my knowledge isn't up-to-scratch.
TL;DR: Is
micropython-lib
aiming at becoming the PyPi of Micropython?@BrianPugh and I have been discussing the adoption use of package managers and the different indexes that exist (e.g. like PyPi). One issue that exists within the micropython ecosystem is that there is no primary index, where packages can be downloaded from. And I guess
micropython-lib
is trying to bridge that gap, which I think is great.User contributions
One question I have is whether the
micropython-lib
will be open to user contributions like PyPi? This would go a long way towards minimizing the need to install custom firmware (e.g.pimoroni-pico
), if Pimoroni (and everyone else) could submit their libraries.Board specification
An additional concern of the current state-of-affairs is package versioning, which could also be resolved with a package manager. However, this of course needs to be baked into the index as well. Is it, and if yes, how is it implemented in
micropython-lib
? And is there a way of choosing compatible boards, e.g. can you state compatible boards inpackage.json
?I hope this is something we can discuss, as I believe having a more complete, accessible index will make
micropython
as versatile as Python currently is.The text was updated successfully, but these errors were encountered: