recipes/apycot.setup.distutils.py
author David Douard <david.douard@logilab.fr>
Fri, 14 Nov 2014 12:51:47 +0100
changeset 1740 f3137466457a
child 1591 4218723fabcc
permissions -rw-r--r--
Big Refactoring (BR) of the test execution model Get rid of narval preprocessors in favor of Recipes - Each preprocessing recipe must be run from the "main" recipe (thus we add a ATest.exec_recipe() method that can be called from Recipe execution). - We add a (Repository, checkout_recipe, Recipe) relation, which is the Recipe that tells how to retrieve the code for a given Repository - Also add a (ProjectEnvironment, setup_recipe, Recip) dedicated to perform the installation for a project (compile and install) - Add implementations for these recipes for Python project - Rewrite the quick recipe using this new model

# normally executed with following builtin variables:
# :prefix: where to install
# :writer: log reporter
# :wdir: working directory

from apycotlib import Command

# ensure environment variables are OK
test.update_env(wdir, 'PATH',
                join(wdir, 'sbin'),
                os.pathset)
test.update_env(wdir, 'PATH',
                join(wdir, 'bin'),
                os.pathset)
test.update_env(wdir, 'PYTHONPATH',
                join(wdir, 'lib', 'python'),
                os.pathset)
test.update_env(wdir, 'LD_LIBRARY_PATH',
                join(wdir, 'lib'),
                os.pathset)

cmdargs = ['python', 'setup.py', 'install', '--home', prefix]
Command(writer, cmdargs, raises=True, cwd=wdir)