← index #18711PR #17205
Related · high · value 5.195
QUERY · ISSUE

Allow mpremote mip to download libraries as local files

openby stek29opened 2026-01-22updated 2026-03-09
enhancementtools

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

CANDIDATE · PULL REQUEST

tools/mpremote: For mip install, use hash to skip files that exist.

mergedby dpgeorgeopened 2025-04-29updated 2025-05-02
tools

Summary

When using mip install, if a file that needs to be downloaded already exists locally, then the hash of that local file will be computed and if it matches the known hash of the remote file it will not be downloaded.

This behaviour follows that of the mip package in micropython-lib.

Testing

Tested on RPI_PICO2_W. Prior to this change, with unittest already installed:

$ mpremote mip install unittest
Install unittest
Installing unittest (latest) from https://micropython.org/pi/v2 to /lib
Installing: /lib/unittest/__init__.mpy
Done                                    

With this change:

$ ./mpremote.py mip install unittest
Install unittest
Installing unittest (latest) from https://micropython.org/pi/v2 to /lib
Exists: /lib/unittest/__init__.mpy
Done

Trade-offs and Alternatives

Hashes in mip are guaranteed unique, so this change should never leave stale files on the filesystem.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied