Skip to content

koslab/koslab.recipe.zipapp

Repository files navigation

Support for executing python zip files was added in Python2.6, and in Python3.6, emphasis was added through the zipapp module.

This module contains a buildout recipe and a command line utility to help package Python applications into a zipapp, complete with its setup.py dependencies.

One of the use-case for this module is for building complex Hadoop MapReduce job in Python that relies in many dependencies. The zipapp can be distributed easily to Hadoop nodes for execution, or packaged as a script for Hive's TRANSFORM function

pip install koslab.recipe.zipapp

The following example packages Spotify's Luigi daemon as a zipapp.

# Creates luigi zipapp as luigi.egg
zipapp build luigi -m luigi.cmdline:luigid -o luigi.egg

# Run luigid
python luigi.egg

This recipe depends on collective.recipe.omelette from Plone.

buildout.cfg:

[buildout]
parts =
    omelette
    zipapp

[omelette]
recipe = collective.recipe.omelette
eggs =
    # Eggs to be included into the zipapp
    MyApp

[zipapp]
recipe = koslab.recipe.zipapp
omelette-part = omelette
main-function = MyApp.main:main
output-file = MyApp.pyz

Output file will be created everytime buildout is run

Releases

No releases published

Packages

No packages published

Languages