Commits

Ronny Pfannschmidt committed 005c8cb Merge

merge develop-pip-win32

Comments (0)

Files changed (7)

 1.4.3
 -----------------
 
+- use pip-script.py instead of pip.exe on win32 to avoid the lock exe file on execution issue
+  (thanks Philip Thiem)
+
 - introduce -l|--listenv option to list configured environments
   (thanks  Lukasz Balcerzak)
 
 Jannis Leidl
 Ronny Pfannschmidt
 Lukasz Balcerzak 
+Philip Thiem

doc/announce/release-1.4.3.txt

 - (experimental) "--installpkg=localpath" option which will skip the
   sdist-creation of a package and instead install the given localpath package.
 
+- use pip-script.py instead of pip.exe on win32 to avoid windows locking the .exe
+
 Note that the sister project "detox" should continue to work - it's a 
 separately released project which drives tox test runs on multiple CPUs
 in parallel.

doc/check_sphinx.py

     htmldir = tmpdir.join("html")
     subprocess.check_call([
         "sphinx-build", "-W", "-bhtml",
-          "-d", str(doctrees), ".", str(htmldir)])
+          "-d", str(doctrees), ".", str(htmldir)], shell=True)
 
 def test_linkcheck(tmpdir):
     doctrees = tmpdir.join("doctrees")
     htmldir = tmpdir.join("html")
     subprocess.check_call(
         ["sphinx-build", "-blinkcheck",
-          "-d", str(doctrees), ".", str(htmldir)])
+          "-d", str(doctrees), ".", str(htmldir)], shell=True)
 
 
             if sys.platform != "win32" and isinstance(arg, py.path.local):
                 arg = cwd.bestrelpath(arg)
             newargs.append(str(arg))
+
+        #subprocess does not always take kindly to .py scripts
+        #so adding the interpreter here.
+        if sys.platform == "win32":
+            ext = os.path.splitext(str(newargs[0]))[1].lower()
+            if ext == '.py' and self.venv:
+                newargs = [str(self.venv.getcommandpath())] + newargs
+
         return newargs
 
     def _popen(self, args, cwd, stdout, stderr, env=None):
 
 import tox
 
+
 defaultenvs = {'jython': 'jython', 'pypy': 'pypy'}
 for _name in "py,py24,py25,py26,py27,py30,py31,py32,py33,py34".split(","):
     if _name == "py":
 
             raise tox.exception.ConfigError(
                 "substitution key %r not found" % key)
-        if callable(val):
+        if py.builtin.callable(val):
             val = val()
         return str(val)
 
 
     def pip_install(self, args, indexserver=None, action=None):
         argv = ["pip", "install"] + self._commoninstallopts(indexserver)
+        # use pip-script on win32 to avoid the executable locking
+        if sys.platform == "win32":
+            argv[0] = "pip-script.py"
         if self.envconfig.downloadcache:
             self.envconfig.downloadcache.ensure(dir=1)
             argv.append("--download-cache=%s" %