The pythonic packaging solution
With bento, packages metadata are described in an easy to read bento.info file.
The syntax is indentation-based, as python.
Bento aims at supporting all python versions from 2.4 to 3.x
Name: foo Version: 0.1 Description: Package description. Library: Packages: foo, foo.core
Bento packages are currently installed using bentomaker, the command line interface to bento.
$ bentomaker configure $ bentomaker build $ bentomaker install # Or more simply $ bentomaker install
If your package uses distutils/setuptools/distribute, you can convert your setup.py to bento format using the convert command
# Run this in a project containing a setup.py $ bentomaker convert
# You now have a bento.info file $ bentomaker configure ...
You don't have to give up your favorite packaging tools to benefit from bento, thanks to bento's distutils compatibility layer. A simple 4-lines setup.py will make your bento package works with easy_install or pip:
import setuptools import bento.distutils bento.distutils.monkey_patch() setuptools.setup()
$ easy_install your-bento-package $ pip your-bento-package
To avoid addtional dependencies to your package, bento may be distributed as a single file.
# This will create a self-contained bentomaker # file that you can include in your project $ python tools/createdist.py Created self-contained script 'bentomaker' in ...
# You can now simply add the generated # bentomaker file into your source distribution $ cp bentomaker $my_source_tree $ cd $my_source_tree $ ./bentomaker ...
Bentomaker also supports building source distributions, and preliminary support for windows installers, eggs and Mac OS X .mpkg.
$ bentomaker sdist $ bentomaker build_wininst $ bentomaker build_egg $ bentomaker build_mpkg
Bento aims at making packagers' life easier. Paths may be customized at configuration stage, and those paths may be used inside the bento.info file.
Datafiles: pdf-doc TargetDir: $pdfdoc Files: main.pdf
$ bentomaker configure --pdfdoc=/usr/pdfdoc
Retrieving package data location at runtime indenpendently of their install path is as simple as importing a variable
from yourpackage.__bento_config import PDFDOC
Developing complex packages with C code is now more pleasant thanks to automatic dependency tracking.
By default, bentomaker builds C extensions using yaku, which automatically rebuild necessary files whenver build options of file content change.
It builds C extensions in parallel, too
$ bentomaker build PYCC foo.o PYCC bar.o PYLINK foo.so $ edit foo.c $ bentomaker build PYCC foo.o # Only foo is rebuilt PYLINK foo.so
Bento is designed from the ground up to be extensible, and cleanly separate configuration, build, installation and packaging.
You want to use waf or scons to build C extensions? You want to add support for building debian packages? Bento aims at making those tasks not only possible but easy and robust.