Allow mpremote mip to download libraries as local files
Description
Background
Currently the easiest way to install micropython-lib packages is with mpremote mip install.
However, when using such packages, there's no syntax highlighting and pylance checking.
Adding such packages to import paths for pylance is not trivial, especially since micropython mip has a custom manifest format.
Suggestion
I suggest adding a new subcommand to mpremote mip -- "download", inspired by pip download command.
This command will work just like mip install, but:
- would download files to local fs instead of connected MicroPython board
- would not require a MicroPython board to be connected to work
Then this mpremote mip download command can be used to download packages into a subdirectory added to import paths for IDE/Pylance/linter, and proper tooling can be utilised while using upstream micropython-lib packages.
Code Size
No response
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree
RFC: URL/package.json support in frozen module manifests
Description
manifest.py files currently support installing from micropython-lib with require(); I propose extending the syntax to match that of mip, namely by adding support for a package.json hosted elsewhere (URL, GitHub, or GitLab) and individual .py files by URL.
My initial implementation thoughts are:
- Allow
github:,gitlab:, andhttp://links to be passed torequire()in addition to normal package names - Add an optional
version=<x>keyword argument to match themip.install()interface - Port the existing
mipfunctionality either from the module or from mpremote to download modules to a local cache directory during manifest processing - Add these downloaded files to the
ManifestFiledatabase so they can be frozen into the firmware with the existing manifest machinery
Please let me know if you have any thoughts/comments/suggestions.
Justification: I'm currently working on a project that uses a number of external libraries I freeze into firmware. I'm using git submodules to pull in library dependencies within the project and package()/modules() to include these into the firmware, however:
- I anticipate expanding to multiple firmware variations, which may use different sets of libraries; it may become tedious to set up all required submodules and fetch the correct ones for the firmware being built
- This doesn't provide support for freezing a single
.pyfile (unlikemip) from a repository without cloning the entire repository. For example, I'd like to include thetyping.mpyfile in my firmware for the libraries I use, but I would rather not include the entire repository for it as a submodule.
Code Size
No response
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree