Hacker News new | past | comments | ask | show | jobs | submit login

Is there a good way to build a portable package containing dependencies for installing on an airgapped system?



Take a look at Twitter PEX. I gave a short talk on it earlier this year (https://www.youtube.com/watch?v=abnwINA50DE).


Pex doesn't support pep 517 but shiv does.


Nice but ugh. Python packaging world really sucks. In R I was able to do this very easily with minicran.


Another one: https://github.com/facebookincubator/xar "XAR lets you package many files into a single self-contained executable file. This makes it easy to distribute and install... A popular example is Python application archives that include all Python source code files, as well as native shared libraries, configuration files, other data."


Have a repo for your code, vendorize every thing, build a binary including Python interpreter using a build system that emphasize on reproducibility (e.g. Bazel).

Alternatively you can build a docker image using Bazel (for reproducibility) and use tools like Droot to chroot into the image then run.


Do you depend on any native library? If not, you should be able to install everything in a virtualenv and move that whole directory.


Surprised no one has mentioned cx_Freeze yet:

https://cx-freeze.readthedocs.io/en/latest/

It's worked pretty well for us on both Linux and Windows environments.


Make a wheel or use shiv. Either is very easy.


Is it possible to build a wheel for a unix platform on a windows machine, when the package and some of its dependencies have compiled portions? I'm trying to build a wheel with deps for exchangelib and have been struggling.


For certain values of 'good', containers seem to enjoy popularity.


Shivs as mentioned elsewhere, pyoxidize is also worth a look




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: