-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·39 lines (33 loc) · 1.64 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
"""
The main purpose of this file is to run tox only with the current existing python interpretors.
"""
import os
import sys
import logging
import sys
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF8')
if __name__ == "__main__":
log = logging.getLogger()
# now we'll detect which python interpretors we have on this machine and run the tests for all of them
#'python2.5':'py25',
known_pys = { 'python2.6':'py26', 'python2.7':'py27', 'python3.3':'py33', 'python3.4':'py34' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}
#known_pys = { 'python2.7':'py27' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}
detected_pys = set()
for known_py in known_pys:
if os.system("which %s >/dev/null" % known_py) == 0:
detected_pys.add(known_pys[known_py])
detected_pys.add('docs')
#os.system("python setup.py test")
#pip_cmd = "pip install --user --upgrade"
pip_cmd = "pip install --user " # "--exists-action w" not existing everywhere
cmds = ["%s -r requirements.txt" % pip_cmd,
"%s -r requirements-dev.txt" % pip_cmd,
"%s -r requirements-opt.txt || echo 'Warning: optional requirements install failed.'" % pip_cmd,
"python -m autopep8 --ignore=E501 -i *.py tests/*.py jira/*.py examples/*.py || echo 'Warning: autopep8 failed'",
"python -m tox -e %s" % ",".join(detected_pys)]
for cmd in cmds:
if os.system(cmd) != 0:
print("ERROR: Command `%s` failed, testing stopped here." % cmd)
sys.exit(6)