summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-07-10 16:44:42 -0400
committerMonty Taylor <mordred@inaugust.com>2013-07-10 16:44:42 -0400
commit1305a6c913cc3f86978c966ed36c3e48f61d70ec (patch)
treefcbcbe530fa14dccb7e733f3eeff5ed6b4bf7f93
parentfe772b4f5fea2b508bd29b4e82ac6fb9ba06a049 (diff)
downloadtox-1305a6c913cc3f86978c966ed36c3e48f61d70ec.tar.gz
Make sure that the venv is finalized.
Skipping sdist causes the config to not be saved, which causes recreation next time.
-rw-r--r--tox/_cmdline.py8
-rw-r--r--tox/_venv.py5
2 files changed, 12 insertions, 1 deletions
diff --git a/tox/_cmdline.py b/tox/_cmdline.py
index 97a3230..02cdf09 100644
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -327,6 +327,12 @@ class Session:
return False
return True
+ def finishvenv(self, venv):
+ action = self.newaction(venv, "finishvenv")
+ with action:
+ venv.finish()
+ return True
+
def installpkg(self, venv, sdist_path):
action = self.newaction(venv, "installpkg", sdist_path)
with action:
@@ -375,6 +381,8 @@ class Session:
if self.setupenv(venv):
if not self.config.skipsdist:
self.installpkg(venv, sdist_path)
+ else:
+ self.finishvenv(venv)
self.runtestenv(venv)
retcode = self._summary()
return retcode
diff --git a/tox/_venv.py b/tox/_venv.py
index f23557a..9b62f02 100644
--- a/tox/_venv.py
+++ b/tox/_venv.py
@@ -197,11 +197,14 @@ class VirtualEnv(object):
self._pcall(args, venv=False, action=action, cwd=basepath)
self.just_created = True
+ def finish(self):
+ self._getliveconfig().writeconfig(self.path_config)
+
def installpkg(self, sdistpath, action):
assert action is not None
if getattr(self, 'just_created', False):
action.setactivity("inst", sdistpath)
- self._getliveconfig().writeconfig(self.path_config)
+ self.finish()
extraopts = []
else:
action.setactivity("inst-nodeps", sdistpath)