On Thu, May 28, 2015, 12:14 Barry Warsaw
I think docker is a pretty crummy answer to Go’s static binaries. What I would love is for Python to get:
* The ability to import .so modules via zipzimport (ideally without a temporary directory, but that might require newer APIs from libc and such).
+1 - Thomas Wouters mentioned at the language summit some work being done on glibc to add dlopen_from_memory() (sp?) which would allow for loading .so files directly from a zip. Not sure what the status is of that, but it would be a great addition.
* The ability to create a “static” Python that links everything it needs into the binary to do a zipimport of everything else (including the stdlib).
+1
*The ability to execute a zipfile that has been concat onto the end of the
Python binary.
+1
I think that if we get all of that, we could easily create a single file executable with real, native support from Python by simply compiling Python in that static mode and then appending a zip file containing the standard library and any other distributions we need to the end of it.
We’d probably want some more quality of life improvements around accessing resources from within that zip file as well, but that can be done as a library easier than the above three things can.
E.g. you really should be using the pkg_resources APIs for loading resources from your packages, otherwise you're gonna have problems with zip executables. We've talked before about adopting some of these APIs into Python's stdlib. pkgutil is a start, and the higher level APIs from pkg_resources should probably go there. Donald Stuff proposed importlib.resources a little while back to handle the storage-agnostic api dor reading data and I have been thinking about it for years. I plan to make it happen in Python 3.6. -brett Cheers, -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/brett%40python.org