Commits

Ronny Pfannschmidt committed 687e65d

some more patches

Comments (0)

Files changed (2)

homedir-not-for-ci

+# HG changeset patch
+# Parent b120421aaa7edfc91cfe0a4bf1a57da2bf0f2edf
+dont use homedir in ci context
+
+diff --git a/tox/_config.py b/tox/_config.py
+--- a/tox/_config.py
++++ b/tox/_config.py
+@@ -115,18 +115,20 @@ class parseini:
+         config._cfg = self._cfg
+         self.config = config
+         ctxname = getcontextname()
+-        if ctxname == "jenkins":
++        if ctxname.isalnum():
+             reader = IniReader(self._cfg, fallbacksections=['tox'])
+             toxsection = "tox:%s" % ctxname
+             distshare_default = "{toxworkdir}/distshare"
+-        elif not ctxname:
++            # if context is text, we are in ci and dont have a home
++            config.homedir = None
++        elif ctxname is None:
+             reader = IniReader(self._cfg)
+             toxsection = "tox"
+             distshare_default = "{homedir}/.tox/distshare"
++            config.homedir = py.path.local._gethomedir()
+         else:
+-            raise ValueError("invalid context")
++            raise ValueError("invalid context %r"%ctxname)
+ 
+-        config.homedir = py.path.local._gethomedir()
+         reader.addsubstitions(toxinidir=config.toxinidir,
+                               homedir=config.homedir)
+         config.toxworkdir = reader.getpath(toxsection, "toxworkdir",
 context-discovery
+homedir-not-for-ci