4 ms·
Having used the combination of Gradle and Capsule in Java-land, I desperately want to equivalent for Python. A tool that can declarative state dependencies and
by dikaiosune 11y ago
Having used the combination of Gradle and Capsule in Java-land, I desperately want to equivalent for Python. A tool that can declarative state dependencies and bundle them into a single file (akin to a static binary) which has a single entry point and all dependencies included. For libraries, the JAR model works well too.
- adambrenecki 11y agoIn theory, `pex` can do exactly this. (In practice, I had a brief play with it and couldn't get it to work, YMMV.)
- pmahoney 11y agoI don't know the state of Python packaging in Nix [1], but it can almost do what you ask. I've used it to create a tarball of, for example, a customized Postgres (built with MySQL foreign data wrapper in this case), and all its dependencies down to libc (there's an implicit dependency on a Linux kernel), and unpack and run it on a Linux system where Nix package manager is not installed. I've done similar for Ruby projects using many gems with various C library dependencies, though I used a fair bit of custom Nix definitions for this (i.e. at the time, the state of Ruby packaging in Nix was poor; I'm not sure of the current status). A signifiant requirement is that it must live in /nix (it's theoretically possible to build everything for another path, but I don't think many people do this so there may be surprises). And this is all easier if the target system has a Nix package manager, rather than dealing with (somewhat bulky, since includes everything) tarballs. [1] http://nixos.org/nix/ http://nixos.org/nix/
- falsedan 11y agoI use dh_virtualenv OR `pip install --download-cache=vendor dist/package.tgz` in rpmbuild & `pip install --download vendor pckage.tgz` (+ virtualenv fiddling) in postinst