summaryrefslogtreecommitdiffstats
path: root/testing/talos/INSTALL.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/talos/INSTALL.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/talos/INSTALL.py')
-rwxr-xr-xtesting/talos/INSTALL.py70
1 files changed, 70 insertions, 0 deletions
diff --git a/testing/talos/INSTALL.py b/testing/talos/INSTALL.py
new file mode 100755
index 000000000..debc843f0
--- /dev/null
+++ b/testing/talos/INSTALL.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+
+"""
+installation script for talos. This script:
+- creates a virtualenv in the current directory
+- sets up talos in development mode: `python setup.py develop`
+- downloads pageloader and packages to talos/page_load_test/pageloader.xpi
+"""
+
+import os
+import subprocess
+import sys
+import urllib2
+try:
+ from subprocess import check_call as call
+except:
+ from subprocess import call
+
+# globals
+here = os.path.dirname(os.path.abspath(__file__))
+VIRTUALENV = 'https://raw.github.com/pypa/virtualenv/1.10/virtualenv.py'
+
+
+def which(binary, path=os.environ['PATH']):
+ dirs = path.split(os.pathsep)
+ for dir in dirs:
+ if os.path.isfile(os.path.join(dir, path)):
+ return os.path.join(dir, path)
+ if os.path.isfile(os.path.join(dir, path + ".exe")):
+ return os.path.join(dir, path + ".exe")
+
+
+def main(args=sys.argv[1:]):
+
+ # sanity check
+ # ensure setup.py exists
+ setup_py = os.path.join(here, 'setup.py')
+ assert os.path.exists(setup_py), "setup.py not found"
+
+ # create a virtualenv
+ virtualenv = which('virtualenv') or which('virtualenv.py')
+ if virtualenv:
+ call([virtualenv, '--system-site-packages', here])
+ else:
+ process = subprocess.Popen([sys.executable,
+ '-',
+ '--system-site-packages',
+ here],
+ stdin=subprocess.PIPE)
+ stdout, stderr = process.communicate(input=urllib2.urlopen(VIRTUALENV).read())
+
+ # find the virtualenv's python
+ for i in ('bin', 'Scripts'):
+ bindir = os.path.join(here, i)
+ if os.path.exists(bindir):
+ break
+ else:
+ raise AssertionError('virtualenv binary directory not found')
+ for i in ('python', 'python.exe'):
+ virtualenv_python = os.path.join(bindir, i)
+ if os.path.exists(virtualenv_python):
+ break
+ else:
+ raise AssertionError('virtualenv python not found')
+
+ # install talos into the virtualenv
+ call([os.path.abspath(virtualenv_python), 'setup.py', 'develop'], cwd=here)
+
+if __name__ == '__main__':
+ main()