-
Notifications
You must be signed in to change notification settings - Fork 1.1k
mip: Allow accessing index from local filesystem #987
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Just set the index to `file://relative/path` or `file:///absolute/path`. Signed-off-by: Dominik Heidler <dheidler@suse.de>
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. |
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. |
Look here where I backported the patch from this PR to see exactly what I'm doing: |
Install of packages from a local filesystem I think I remember this being part of a Packaging this repo for Suse |
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? |
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__.py
index 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? |
Opened #989 |
Just set the index to
file://relative/path
orfile:///absolute/path