summaryrefslogtreecommitdiff
path: root/tox
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2015-04-21 11:51:10 +0200
committerholger krekel <holger@merlinux.eu>2015-04-21 11:51:10 +0200
commitb38964389b2df20c166df11906d77a3f7d56ab76 (patch)
treeb5ae245140aea4867135b245d698316483348a4c /tox
parent5460ace40a08b880ebce23cee9d62f2d4999790f (diff)
downloadtox-b38964389b2df20c166df11906d77a3f7d56ab76.tar.gz
trying out isolating env variables
Diffstat (limited to 'tox')
-rw-r--r--tox/__init__.py2
-rw-r--r--tox/_config.py12
-rw-r--r--tox/_venv.py5
3 files changed, 17 insertions, 2 deletions
diff --git a/tox/__init__.py b/tox/__init__.py
index c206441..95f2dfb 100644
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '1.9.3.dev1'
+__version__ = '2.0.0.dev1'
class exception:
class Error(Exception):
diff --git a/tox/_config.py b/tox/_config.py
index b9ffc62..2fae46a 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -1,6 +1,7 @@
import argparse
import os
import random
+from fnmatch import fnmatchcase
import sys
import re
import shlex
@@ -366,6 +367,17 @@ class parseini:
if config.hashseed is not None:
setenv['PYTHONHASHSEED'] = config.hashseed
setenv.update(reader.getdict(section, 'setenv'))
+
+ # read passenv
+ vc.passenv = set(["PATH"])
+ if sys.platform == "win32":
+ vc.passenv.add("SYSTEMROOT") # needed for python's crypto module
+ vc.passenv.add("PATHEXT") # needed for discovering executables
+ for spec in reader.getlist(section, "passenv", sep=" "):
+ for name in os.environ:
+ if fnmatchcase(name, spec):
+ vc.passenv.add(name)
+
vc.setenv = setenv
if not vc.setenv:
vc.setenv = None
diff --git a/tox/_venv.py b/tox/_venv.py
index eff932d..8666785 100644
--- a/tox/_venv.py
+++ b/tox/_venv.py
@@ -326,7 +326,10 @@ class VirtualEnv(object):
action=action, extraenv=extraenv)
def _getenv(self, extraenv={}):
- env = os.environ.copy()
+ env = {}
+ for envname in self.envconfig.passenv:
+ if envname in os.environ:
+ env[envname] = os.environ[envname]
setenv = self.envconfig.setenv
if setenv:
env.update(setenv)