-
Notifications
You must be signed in to change notification settings - Fork 41
/
check-dependencies.py
executable file
·43 lines (36 loc) · 1.17 KB
/
check-dependencies.py
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
#!/usr/bin/env python
"""Script to verify required/optional dependencies are installed."""
import sys
errors = 0
try:
from bs4 import BeautifulSoup
except ImportError:
print "Could not import BeautifulSoup. This is a required module for Binder. It is automatically installed with pybindxml.\n"
errors += 1
try:
import django
except ImportError:
print "Could not import Django. This is a required package for Binder.\n"
errors += 1
try:
import dns
except ImportError:
print "Could not import dns. This is a required module for Binder."
print "Package is typically called 'python-dnspython.'\n"
errors += 1
try:
import pybindxml
except ImportError:
print "Could not import pybindxml. This is a required module for Binder.\n"
print "Pybindxml: https://pypi.python.org/pypi/pybindxml"
errors += 1
try:
import flup
except ImportError:
print "Could not import flup. This is an optional module if you intend to run Binder under fastcgi."
print "Package is typically called 'python-flup.'\n"
if errors:
print "Critical missing packages found: %d.\n" % errors
sys.exit(errors)
else:
print "All required packages found!"