2014-05-28 19:00:35 +02:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from bootstrapvz.common import phases
|
|
|
|
|
|
|
|
|
|
|
|
class AddPipPackage(Task):
|
2016-06-04 11:35:59 +02:00
|
|
|
description = 'Adding `pip\' and Co. to the image packages'
|
|
|
|
phase = phases.preparation
|
2014-05-28 19:00:35 +02:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
|
|
|
for package_name in ('python-pip', 'build-essential', 'python-dev'):
|
|
|
|
info.packages.add(package_name)
|
2014-05-28 19:00:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
class PipInstallCommand(Task):
|
2016-06-04 11:35:59 +02:00
|
|
|
description = 'Install python packages from pypi with pip'
|
|
|
|
phase = phases.system_modification
|
2014-05-28 19:00:35 +02:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
|
|
|
from bootstrapvz.common.tools import log_check_call
|
|
|
|
packages = info.manifest.plugins['pip_install']['packages']
|
|
|
|
pip_install_command = ['chroot', info.root, 'pip', 'install']
|
|
|
|
pip_install_command.extend(packages)
|
|
|
|
log_check_call(pip_install_command)
|