Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Once and for all deal with dockerpy's brokenness #43
Merged
mbruzek
merged 5 commits into
juju-solutions:master
from
chuckbutler:dockerpy-resolution
Apr 18, 2016
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
Jump to file or symbol
Failed to load files and symbols.
| @@ -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() |
| @@ -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 | ||
| + |