forked from pycontribs/tendo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare
executable file
·49 lines (37 loc) · 2.24 KB
/
prepare
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
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
import os
import sys
import logging
import platform
"""
TODO:
sudo easy_install -q docutils sphinx six pylint sphinx-pypi-upload pytest-pep8 rednose
"""
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
known_pys = { 'python2.5':'py25', 'python2.6':'py26', '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])
if os.system("easy_install --help >/dev/null 2>&1") != 0:
print("Dude, you are hopeless, you dont even have easy_install, please intall it, ususaly with '[apt-get|yum|brew] install python-setuptools'")
elif os.system("tox --version >/dev/null 2>&1 || { sudo easy_install tox || exit 1;}") != 0:
print("tox not found, and I was unable to install it!")
elif os.system("""pep8 --version >/dev/null 2>&1 || { sudo easy_install pep8 || exit 1; }""") != 0:
print("pep8 not found, and I was unable to install it!")
if os.system("""autopep8 --version >/dev/null 2>&1 || { sudo easy_install autopep8 || exit 1; }""") != 0:
print("autopep8 not found")
elif os.system("""py.test --version >/dev/null 2>&1 || { sudo easy_install pytest || exit 1; }""") != 0:
print("py.test not found and I was unable to install it!")
elif os.system("py.test --version 2>&1 | grep -q 'pytest-xdist' || { sudo easy_install pytest-xdist || exit 1;}"):
print("pytest-xdist not found and I was unable to install it!")
elif os.system("py.test --version 2>&1 | grep -q 'pytest-growl' || { sudo easy_install pytest-growl || exit 1;}"):
print("pytest-xdist not found and I was unable to install it!")
elif os.system("py.test --version 2>&1 | grep -q 'pytest-cov' || { sudo easy_install pytest-cov || exit 1;}"):
print("pytest-xdist not found and I was unable to install it!")
else:
print "All requirements are available."
sys.exit(0)
sys.exit(2)