Once and for all deal with dockerpy's brokenness #43

Merged
merged 5 commits into from Apr 18, 2016
View
@@ -1,4 +1,5 @@
includes: ['layer:basic']
+tactics: ['tactics.docker.DockerWheelhouseTactic']
repo: https://github.com/juju-solutions/layer-docker.git
defines:
skip-install:
View
@@ -0,0 +1,28 @@
+from charmtools.build.tactics import WheelhouseTactic
+from charmtools.utils import Process
+import tempfile
+from path import Path as path
+
+
+class DockerWheelhouseTactic(WheelhouseTactic):
+ ''' The references to process, path, and tempfile are implicit
+ below because they come from the global scope of
+ charmtools.utils which gets passed in during
+ charmtools.utils.load_class
+ Investigate there if there is abrupt breakage here.
+ '''
+ def __call__(self, venv=None):
+ create_venv = venv is None
+ venv = venv or path(tempfile.mkdtemp())
+ pip = venv / 'bin' / 'pip3'
+ wheelhouse = self.target.directory / 'wheelhouse'
+ wheelhouse.mkdir_p()
+ if create_venv:
+ Process(('virtualenv', '--python', 'python3', venv)).exit_on_error()() # noqa
+ Process((pip, 'install', '-U', 'pip', 'wheel')).exit_on_error()() # noqa
+ Process((pip, 'install', '-U', 'setuptools')).exit_on_error()() # noqa
+ for tactic in self.previous:
+ tactic(venv)
+ self._add(pip, wheelhouse, '-r', self.entity)
+ if create_venv:
+ venv.rmtree_p()
View
@@ -1,4 +1,5 @@
+setuptools>=19.6,<=20.0
charms.docker>=0.0.1,<=2.0.0
-docker-py==1.7.2
-docker-compose>=1.0.0,<=2.0.0
vcversioner>=2.0.0,<=3.0.0
+docker-compose>=1.0.0,<=2.0.0
+