14 ms·
Exxo – build portable Python binaries
- rmellow 11y agoGreat, but it's not clear how this is different from several other Python packagers like Pyinstaller. Any clues?
- c17r 11y agoSeems comparable to Twitter's PEX: a relocatable venv with custom entry points to act as a binary. PEX also takes the zip approach but allows for not zip safe libraries by unpacking to a directory before running.
- gravypod 11y agoI love that this comes with an apt-get line telling you exactly what you need to install to get running. Every project should do this.
- tcdent 11y ago> "Because your application is run as zipapp, it must be zip safe. ... The main violation against zip safety is using filesystem API..." I like everything about this, except for the possibility that zipapp constraints could haunt me.
- pmorici 11y agoIn what sense is it meant that this is 'portable' it says they only support Linux on x64.
- jkrems 11y agoI was thinking the same but I'm assuming that it's designed to be portable but not yet implemented on other platforms.
- whalesalad 11y agoThe word portable isn't limited to architecture. If you've ever tried to build software with Python and distribute it in a simple way (a-la go, or a Java .jar) it's not easy. This (and others mentioned below, like PEX) aim to make shipping Python app "binaries" around simple, regardless of OS or system Python presence
- pmorici 11y agoThings like py2exe have been around for ages. I was more wondering if this was better or same thing for Linux.
- Kwpolska 11y agoIt IS easy. You can just tell people to `pip install --user your_app` and use it (might need $PATH correction). All Linux distros ship with Python, and if pip is not available, it can be installed easily. Or you can build and ship .rpm/.deb packages if you feel like it.
- fernly 11y ago> Although exxo binary itself is statically linked, included C extensions (if any) are not. All required shared libraries must be installed on the target machine. For example, if you use lxml, you must install libxml2. This is a major shortcoming. It means, e.g. that an app with a PyQt or Wx GUI requires those to be installed on the target system, at the expected level. PyInstaller, cxfreeze, etc. bundle all dependencies into the frozen app making it really independent of the receiving environment. Identifying all those dependencies at build time is _highly_ nontrivial, and packaging them so that the Python import statements work at run-time is even less so.
- deleted 11y ago[deleted]
- zephharben 11y agoI like the approach taken here - pants/PEX is a bit of a monster (no offense intended - it's a very smart monster, but a monster nonetheless). I'm glad to see projects taking a simpler approach to zip apps - pants makes sense if you're trying to package legacy apps with huge sets of dependencies, but it's overkill for smaller apps. However, the author needs to add some test coverage before I'd feel comfortable contributing or using it.