diff options
| author | Monty Taylor <mordred@inaugust.com> | 2013-07-11 11:29:51 -0400 |
|---|---|---|
| committer | Monty Taylor <mordred@inaugust.com> | 2013-07-11 11:29:51 -0400 |
| commit | 00a35f6857b46e2486ac8936bda4ecf3edfb2b6e (patch) | |
| tree | 3eea3a9168d5fac1fc9b143f7362866fa154e473 | |
| parent | 33b85d4875732250490f24a9cde83210dcba83d8 (diff) | |
| download | tox-00a35f6857b46e2486ac8936bda4ecf3edfb2b6e.tar.gz | |
Address code review comments
Use action.popen instead of subprocess.popen.
Allow skipsdist=False and usedevelop=True to coexist.
| -rw-r--r-- | tox/_cmdline.py | 10 | ||||
| -rw-r--r-- | tox/_venv.py | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tox/_cmdline.py b/tox/_cmdline.py index e28c04b..d3fce4d 100644 --- a/tox/_cmdline.py +++ b/tox/_cmdline.py @@ -73,7 +73,7 @@ class Action(object): f.flush() return f - def popen(self, args, cwd=None, env=None, redirect=True): + def popen(self, args, cwd=None, env=None, redirect=True, returnout=False): logged_command = "%s$ %s" %(cwd, " ".join(map(str, args))) f = outpath = None if redirect: @@ -82,6 +82,8 @@ class Action(object): self.id, self.msg, args, env)) f.flush() self.popen_outpath = outpath = py.path.local(f.name) + elif returnout: + f = subprocess.PIPE if cwd is None: # XXX cwd = self.session.config.cwd cwd = py.path.local() @@ -389,9 +391,9 @@ class Session: return for venv in self.venvlist: if self.setupenv(venv): - if self.config.skipsdist: - if self.config.usedevelop: - self.developpkg(venv, self.config.setupdir) + if self.config.usedevelop: + self.developpkg(venv, self.config.setupdir) + elif self.config.skipsdist: self.finishvenv(venv) else: self.installpkg(venv, sdist_path) diff --git a/tox/_venv.py b/tox/_venv.py index f604f10..7b7f4e6 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -1,5 +1,4 @@ from __future__ import with_statement -import subprocess import sys, os, re import py import tox @@ -205,10 +204,9 @@ class VirtualEnv(object): setup_py = setupdir.join('setup.py') setup_cfg = setupdir.join('setup.cfg') args = [str(self.getconfigexecutable()), str(setup_py), '--name'] - output = subprocess.Popen(args, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - out = output.communicate() - name = out[0].strip().decode('utf-8') + output = action.popen(args, cwd=setupdir, redirect=False, + returnout=True) + name = output.strip().decode('utf-8') egg_info = setupdir.join('.'.join((name, 'egg-info'))) for conf_file in (setup_py, setup_cfg): if (conf_file.check() |
