-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathets_depends.py
32 lines (31 loc) · 1.11 KB
/
ets_depends.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
"""
Extract dependency info from ETS setup files.
Should be run from the ETS root directory, which contains the
directories for each ETS package.
"""
import os
from ets import ets_package_names
INDENT = ' '
for pkg_name in ets_package_names.split():
setup_data = dict(__name__='', __file__='setup_data.py')
try:
execfile(os.path.join(pkg_name,'setup_data.py'), setup_data)
INFO = setup_data['INFO']
print '%s %s' % (INFO['name'], INFO['version'])
print INDENT + 'ETS installation dependencies:'
for item in INFO['install_requires']:
print INDENT*2 + str(item)
if 'extras_require' not in INFO:
continue
print INDENT + 'Other dependencies:'
for (key,value) in INFO['extras_require'].items():
if value:
print '%s%s' % ( INDENT*2, key)
try:
for sub_item in value:
print INDENT*3,sub_item
except TypeError:
print INDENT*3,value
except (IOError,), ermsg:
print pkg_name
print INDENT + str(ermsg)