Reputation: 723
I'm looking for the equivalent of an uber-jar in the python world.
It must be a cross-platform distribution, so I don't have to build for multiple targets. That is, I should be able to run it on all platforms like this:
python package.ext
You can assume that the package is pure python (no native code). Is there anything that satisfies these requirements?
I know of the following options, each with deficiencies:
.whl
packages require pip
for installation..egg
containing all package dependencies..zip
files, but AFAICT, the best tooling for creating such a zip is pex (https://github.com/pantsbuild/pex), which I think doesn't support WindowsUpvotes: 12
Views: 1784
Reputation: 19797
One Python alternative to Java's "uber-jar" (made with, say, shade plugin) could be to simply make a tarball of the whole virtual environment, and use it to in your deployment process.
Problem with this approach (as with JAR as well!) is when one of the packages need native libraries. But that is a different story I would say...
Another (modern) alternative is to simply create a Docker image.
Upvotes: 3