-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
mpremote: Support mip install from local package json file. #12476
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
mpremote: Support mip install from local package json file. #12476
Conversation
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12476 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 167 167
Lines 21599 21599
=======================================
Hits 21295 21295
Misses 304 304 ☔ View full report in Codecov by Sentry. |
Thanks @glenn20 mip support for local package install has been on my personal TODO list for some time now! I hadn't thought of targetting the json file directly, I'd been thinking of going straight to manifest - however json support like you've got here is certainly a smaller change. It does mean that any dependencies will be installed from official / online copies I presume? Maybe that's ok for a first pass, though I'm hoping to eventually be able to point mip at a local clone of micropython-lib and install anything straight from there! |
When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
Yes, I was looking at this from the perspective of someone trying to mip package my own packages - and also to write my own local package.json files for micropython packages available out there that haven't yet been mip-ified. You can see that was also the motivation behind the related PR #12477 (relative urls in package.json files). I wasn't thinking about manifest at all.
Ooh - that sounds interesting, but I can see that's a bigger body of work than these trivial PRs. |
Yeah my more common use case is working on changes to modules destined for micropython-lib, hence my thoughts. I do think this use case could be built up to, starting with local json makes sense, then can eventually add layers around that for generating json on-the-fly and maybe calling out to the script that generates all the json files for micropython-lib etc. |
When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
4ecbf11
to
dcf342f
Compare
dcf342f
to
de3752b
Compare
When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
4686afd
to
2a45de9
Compare
Rebased, patched and squashed. |
URLs in package.json may be specified relative to the base URL of the package.json file. When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
Add support for `mpremote mip install package.json` where `package.json` is a json file on the local filesystem. Without this, package json files can only be loaded from http, https, github or gitlab URLs. This is useful for testing `package.json` files for pacages in development and for constructing one's own `package.json` files for Python packages which are not yet available for installation using mip. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2a45de9
to
11c9656
Compare
Thanks for updating, now merged. |
URLs in package.json may be specified relative to the base URL of the package.json file. When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in package.json may be specified relative to the base URL of the package.json file. When taken with PR micropython#12476, allow relative URLs in package.json files to resolve to files on local fs. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
Update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the package.json file (PR micropython#12477). Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in package.json may be specified relative to the base URL of the package.json file. Relative URLs wil work for package.json files installed from the web as well as local file paths. Update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the package.json file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in package.json.
URLs in package.json may be specified relative to the base URL of the package.json file. Relative URLs wil work for package.json files installed from the web as well as local file paths. Update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the package.json file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in package.json. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in package.json may be specified relative to the base URL of the package.json file. Relative URLs wil work for package.json files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the package.json file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in package.json. Add tools/mpremote/tests/test_mip_local_install.sh to test the installation of a package from local files using relative URLs in the package.json. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in `package.json` may now be specified relative to the base URL of the `package.json` file. Relative URLs wil work for `package.json` files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the `package.json` file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in `package.json`. Add `tools/mpremote/tests/test_mip_local_install.sh` to test the installation of a package from local files using relative URLs in the `package.json`. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in `package.json` may now be specified relative to the base URL of the `package.json` file. Relative URLs wil work for `package.json` files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the `package.json` file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in `package.json`. Add `tools/mpremote/tests/test_mip_local_install.sh` to test the installation of a package from local files using relative URLs in the `package.json`. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in `package.json` may now be specified relative to the base URL of the `package.json` file. Relative URLs wil work for `package.json` files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the `package.json` file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in `package.json`. Add `tools/mpremote/tests/test_mip_local_install.sh` to test the installation of a package from local files using relative URLs in the `package.json`. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in `package.json` may now be specified relative to the base URL of the `package.json` file. Relative URLs wil work for `package.json` files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the `package.json` file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in `package.json`. Add `tools/mpremote/tests/test_mip_local_install.sh` to test the installation of a package from local files using relative URLs in the `package.json`. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
URLs in `package.json` may now be specified relative to the base URL of the `package.json` file. Relative URLs wil work for `package.json` files installed from the web as well as local file paths. Docs: update `docs/reference/packages.rst` to add documentation for: - Installing packages from local filesystems (PR micropython#12476); and - Using relative URLs in the `package.json` file (PR micropython#12477); - Update the packaging example to encourage relative URLs as the default in `package.json`. Add `tools/mpremote/tests/test_mip_local_install.sh` to test the installation of a package from local files using relative URLs in the `package.json`. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
Add support for:
mpremote mip install package.json
wherepackage.json
is a json file on the local filesystem.Without this PR, package json files can only be loaded from http, https or github urls.
This is useful for testing package.json files for pacages in development and for constructing one's own package.json files for python packages which are not yet available for installation using mip.