Bug 1009004 - [TPS] Use the python executable from within the venv for the installation. r=hskupin a=test-only DONTBUILD
authorCosmin Malutan <cosmin.malutan@softvision.ro>
Fri, 06 Jun 2014 08:31:32 +0200
changeset 206190 7297cfffd91c930525a9f2acfcd084ad5ae7decf
parent 206189 4a552fb1ca38e5eabb53d59db9f8568f7f67676b
child 206191 c8288d0c7a1544a590a0cac9c39397ac10c8a45b
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershskupin, test-only
bugs1009004
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1009004 - [TPS] Use the python executable from within the venv for the installation. r=hskupin a=test-only DONTBUILD
testing/tps/create_venv.py
--- a/testing/tps/create_venv.py
+++ b/testing/tps/create_venv.py
@@ -33,19 +33,21 @@ See runtps --help for all options
 
 ***********************************************************************
 """
 virtualenv_url = 'https://raw.github.com/pypa/virtualenv/1.9.1/virtualenv.py'
 
 if sys.platform == 'win32':
     bin_name = os.path.join('Scripts', 'activate.bat')
     activate_env = os.path.join('Scripts', 'activate_this.py')
+    python_env = os.path.join('Scripts', 'python.exe')
 else:
     bin_name = os.path.join('bin', 'activate')
     activate_env = os.path.join('bin', 'activate_this.py')
+    python_env = os.path.join('bin', 'python')
 
 def main():
     parser = optparse.OptionParser('Usage: %prog [options] path_to_venv')
     parser.add_option('-p', '--python',
                       type='string',
                       dest='python',
                       metavar='PYTHON_BIN',
                       default=None,
@@ -60,23 +62,22 @@ def main():
     # Create a virtual environment
     urllib.urlretrieve(virtualenv_url, 'virtualenv.py')
     cmd_args = [sys.executable, 'virtualenv.py', target]
     if options.python:
         cmd_args.extend(['-p', options.python])
     subprocess.check_call(cmd_args)
 
     # Activate tps environment
-
     tps_env = os.path.join(target, activate_env)
     execfile(tps_env, dict(__file__=tps_env))
 
     # Install TPS in environment
-    subprocess.check_call(['python', os.path.join(here, 'setup.py'),
-                           'install'])
+    subprocess.check_call([os.path.join(target, python_env),
+                           os.path.join(here, 'setup.py'), 'install'])
 
     # Get the path to tests and extensions directory by checking check where
     # the tests and extensions directories are located
     sync_dir = os.path.abspath(os.path.join(here, '..', '..', 'services',
                                             'sync'))
     if os.path.exists(sync_dir):
         testdir = os.path.join(sync_dir, 'tests', 'tps')
         extdir = os.path.join(sync_dir, 'tps', 'extensions')