forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imports.py
executable file
·65 lines (58 loc) · 1.53 KB
/
imports.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
import traceback
import os, sys
#import gc
#class Importer:
# def __init__(self,name):
# self.error=0
# try:
# importlib.import_module(i)
# print "Done"
# except Exception as e:
# print "Fail"
# print traceback.format_exc()
# self.error = 1
#
# def err(self):
# return self.error
baseDirs=[]
from subprocess import Popen,PIPE
for p in ['py2-pippkgs','py2-pippkgs_depscipy']:
comm="scram tool info "+p+" | grep PYTHONPATH | cut -f2 -d="
p=Popen(comm,stdout=PIPE,shell=True)
baseDir=p.stdout.read().strip()
baseDirs.append(baseDir)
l=[]
for baseDir in baseDirs:
for root, dirs, files in os.walk(baseDir):
for file in files:
if file.endswith('.py'):
l.append(file[:-3])
for file in dirs:
if 'egg-info' in file: continue
if 'dist-info' in file: continue
l.append(file)
break
#print l
skipIt=['pytest','climate','theanets','hyperopt','thriftpy']
# climate misses plac
# pytest misses py
# theanets misses plac
#hyperopt misses builtins
#thriftpy misses ply
#unless the llvm version in cmssw matches that of root, uproot needs to be
#tested separately (https://github.com/scikit-hep/uproot/issues/58)
#import importlib
#err = 0
for i in l:
if i in skipIt: continue
print i
#
# if i in skipIt: continue
# print "Importing",i,".....",
# d=Importer(i)
# err+=d.err()
# del d
# gc.collect()
#
#sys.exit(err)