- Notifications
You must be signed in to change notification settings - Fork1.1k
mip: Allow accessing index from local filesystem#987
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Just set the index to `file://relative/path` or `file:///absolute/path`.Signed-off-by: Dominik Heidler <dheidler@suse.de>
Josverl commentedMar 15, 2025
Can you explain what the problem is that you are trying to solve? Your current description is so terse, I'm not sure that I understand what you are trying to solve. |
aylen384 commentedMar 15, 2025
There are two use cases I want to cover: For local testing (especially but not necessarily limited to) using the unix port. 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 commentedMar 15, 2025
Look here where I backported the patch from this PR to see exactly what I'm doing: |
Josverl commentedMar 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Install of packages from a local filesystem I think I remember this being part of a Packaging this repo for Suse |
aylen384 commentedMar 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If I get it right, In general I think this would be the cleanest way to implement this. I actually was surprized that it wasn't implemented, yet, which is why I created this PR. An alternative would be to send all Regarding the size I guess you are talking abount the 131 bytes of increased size of the (mpy-cross) compiled version of mpy? |
aylen384 commentedMar 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Here is how to do it by modifying requests - it only costs 50 bytes: diff --git a/python-ecosys/requests/requests/__init__.py b/python-ecosys/requests/requests/__init__.pyindex 2951035..db22569 100644--- a/python-ecosys/requests/requests/__init__.py+++ b/python-ecosys/requests/requests/__init__.py@@ -71,6 +71,10 @@ def request( import tls port = 443+ elif proto == "file:":+ r = Response(open(url[7:], 'b'))+ r.status_code = 200+ return r else: raise ValueError("Unsupported protocol: " + proto) is that better? |
aylen384 commentedMar 24, 2025
Opened#989 |
Just set the index to
file://relative/pathorfile:///absolute/path