So we need a tool:
pkgit --help
from pkgit.easy_pkg import parse
parse().print_help()
usage: pkgit [-h] [-v] [-p PACKAGE] [-i INSTALL] [-w WININST] [-c CREATE] [-y PACKAGED] [--without WITHOUT] [--deps DEPS] [--versions] [--force] [--dest-dir DEST_DIR] [--rm-tmp] [--rm-tmp-all] [--dry-run] Permit to package modules thanks to formulas. Main commands are --package, --wininst, --create (package existing formula, create windows installer, create new formula). optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -p PACKAGE, --package PACKAGE Package formula named PACKAGE. Available formulas are: 'alinea', 'ann', 'bisonflex', 'boost', 'cgal', 'cmake', 'configobj', 'dateutil', 'gnuplot', 'inno', 'ipython', 'lpy', 'matplotlib', 'mingw', 'mingw_rt', 'mtg', 'numpy', 'oalab', 'openalea', 'pillow', 'plantgl', 'pygments', 'pylsm', 'pyopengl', 'pyparsing', 'pyqglviewer', 'pyqscintilla', 'pyqt4', 'python', 'pywin', 'qglviewer', 'qhull', 'qscintilla', 'qt4', 'qt4_dev', 'r', 'rpy2', 'scipy', 'scons', 'setuptools', 'sip', 'skimage', 'svn', 'vplants'. -i INSTALL, --install INSTALL Package formula named INSTALL if necessary and install it. -w WININST, --wininst WININST Create Windows installer for formula WININST. -c CREATE, --create CREATE Create a new formula named CREATE. -y PACKAGED, --packaged PACKAGED Display if formula is yet packaged. --without WITHOUT Omit to package WITHOUT and WITHOUT's dependencies. Works with --package --deps DEPS Display dependencies of formula named DISP_DEPS. --versions Display all formulas available and versions of packages. --force Force packaging. Works with --package --dest-dir DEST_DIR copy result to DIR. Works with --package --rm-tmp Remove temporary files after packaging(except download). Works with --package --rm-tmp-all Remove all temporary files after packaging. Works with --package --dry-run Don't do anything. Works with --package
pkgit --package cgal
Methods (in the good order) and corresponding flags:
Options:
Create a new formula.
One dependency = One formula file
To create a new formula to dependency “my_amazing_package”:
pkgit --create my_amazing_package
#my_amazing_package.py
from openalea.pkgit.formula import Formula
class My_amazing_package(Formula):
download_url = "http://..."
download_name = "my_amazing_package.zip"
version = "1.42.0"
Package formula withh 'pkgit --package' and then install it.
pkgit --install ann
Dsiplay available formulas and corresponding versions.
pkgit --versions
from pkgit.utils import versions
versions()
['alinea 1.1', 'ann 1.1.2', 'bisonflex 2.4.1', 'boost 1.48.0', 'cgal 4.2', 'cmake 2.8.11.2', 'configobj 4.7.2', 'dateutil 2.2', 'gnuplot 4.6.3', 'inno 5.5.3', 'ipython 1.1.0', 'lpy 2.1.0', 'matplotlib 1.3.1', 'mingw 5.1.4_4c', 'mingw_rt 5.1.4_4c', 'mtg 1.1', 'numpy 1.8.0', 'oalab 0.1', 'openalea 1.1', 'pillow 2.1.0', 'plantgl 2.16.1', 'pygments 1.6', 'pylsm 0.1-r34', 'pyopengl 3.0.2', 'pyparsing 1.5.7', 'pyqglviewer 0.11', 'pyqscintilla 1.0', 'pyqt4 4.10.3', 'python 2.7.6', 'pywin 218', 'qglviewer 1.0', 'qhull 2012.1', 'qscintilla 2.6.2', 'qt4 4.8.5', 'qt4_dev 4.8.5', 'r 2.15.3', 'rpy2 2.3.6', 'scipy 0.13.2', 'scons 2.3.0', 'setuptools 0.6c11', 'sip 4.15.2', 'skimage 0.9.3', 'svn 1.8.5', 'vplants 1.1']
Display dependencies of selected formula
pkgit --deps openalea
from pkgit.utils import deps
deps("openalea")
['python', 'pywin', 'mingw', 'mingw_rt', 'qt4', 'numpy', 'scipy', 'matplotlib', 'qscintilla', 'pyqscintilla', 'setuptools', 'pillow', 'pylsm', 'svn', 'dateutil', 'pygments', 'ipython', 'inno', 'openalea']
Check if formula named “formula_name” is yet packaged (locally).
pkgit --packaged pyqscintilla
from pkgit.utils import packaged
packaged("pyqscintilla")
pyqscintilla NOT packaged
False
Proposed solutions: