diff options
author | holger krekel <holger@merlinux.eu> | 2015-06-18 16:07:12 +0200 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2015-06-18 16:07:12 +0200 |
commit | 0c82e9c32d2f0b1209967f774325f0f780f83e97 (patch) | |
tree | 483d1430c17837a114dc1fa641d5319cd51510ee /tox/venv.py | |
parent | c29c60b2d5d422b50882c0788e17a8f6d7fe1f56 (diff) | |
download | tox-0c82e9c32d2f0b1209967f774325f0f780f83e97.tar.gz |
allow all env variables during installation of dependencies
Diffstat (limited to 'tox/venv.py')
-rw-r--r-- | tox/venv.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tox/venv.py b/tox/venv.py index eb2fadc..2f5d583 100644 --- a/tox/venv.py +++ b/tox/venv.py @@ -317,16 +317,22 @@ class VirtualEnv(object): action=action, extraenv=extraenv) def _getenv(self, extraenv={}): - env = {} - for envname in self.envconfig.passenv: - if envname in os.environ: - env[envname] = os.environ[envname] + if extraenv is None: + # for executing tests + env = {} + for envname in self.envconfig.passenv: + if envname in os.environ: + env[envname] = os.environ[envname] + else: + # for executing install commands + env = os.environ.copy() env.update(self.envconfig.setenv) env['VIRTUAL_ENV'] = str(self.path) + if extraenv is not None: + env.update(extraenv) - env.update(extraenv) return env def test(self, redirect=False): @@ -357,7 +363,7 @@ class VirtualEnv(object): try: self._pcall(argv, cwd=cwd, action=action, redirect=redirect, - ignore_ret=ignore_ret) + ignore_ret=ignore_ret, extraenv=None) except tox.exception.InvocationError as err: self.session.report.error(str(err)) self.status = "commands failed" |