1
from charmtools.build.tactics import WheelhouseTactic
2
from charmtools.utils import Process
4
from path import Path as path
7
class DockerWheelhouseTactic(WheelhouseTactic):
8
''' The references to process, path, and tempfile are implicit
9
below because they come from the global scope of
10
charmtools.utils which gets passed in during
11
charmtools.utils.load_class
12
Investigate there if there is abrupt breakage here.
14
def __call__(self, venv=None):
15
create_venv = venv is None
16
venv = venv or path(tempfile.mkdtemp())
17
pip = venv / 'bin' / 'pip3'
18
wheelhouse = self.target.directory / 'wheelhouse'
21
Process(('virtualenv', '--python', 'python3', venv)).exit_on_error()() # noqa
22
Process((pip, 'install', '-U', 'pip', 'wheel')).exit_on_error()() # noqa
23
Process((pip, 'install', '-U', 'setuptools')).exit_on_error()() # noqa
24
for tactic in self.previous:
26
self._add(pip, wheelhouse, '-r', self.entity)