micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

requests: Support file:// scheme for local files

Open aylen384 opened this issue 9 months ago • 2 comments

This allows installing packages using mip from an index served from the local fs.

Usecases:

For local testing (especially but not necessarily limited to) using the unix port. So you can locally generate an index from the repo and install packages from the index without starting a local http server.

And for packaging the complete index of this repo for the opensuse rpm (micropython-lib) without needing to launch an http server within the build environment. Previous we were using the makefile that was dropped from this repo so I decided to generate a local index and then install all packages contained in that index to the buildroot.

aylen384 avatar Mar 24 '25 15:03 aylen384

Thanks for the patch.

But, I'm not sure this is a good addition. It doesn't seem to be supported by CPython's requests module?

Also, some work was done recently with mip to allow installing from the local filesystem, see https://github.com/micropython/micropython/pull/12477 . Does that cover your use case?

dpgeorge avatar Apr 10 '25 06:04 dpgeorge

This does not cover my usecase as I can't install packages locally (on the local linux system) using mpremote.

This patch was adding way less memory than patching (the non-mpremote) mip here, so that's why I did it like this.

aylen384 avatar Apr 10 '25 07:04 aylen384