diff --git a/PhysicsTools/PythonAnalysis/test/imports.py b/PhysicsTools/PythonAnalysis/test/imports.py index aa281f280496f..a1cddff3f0bbc 100755 --- a/PhysicsTools/PythonAnalysis/test/imports.py +++ b/PhysicsTools/PythonAnalysis/test/imports.py @@ -1,6 +1,21 @@ #!/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 @@ -23,26 +38,28 @@ l.append(file) break -print l - +#print l skipIt=['pytest','climate','theanets','hyperopt','thriftpy'] # climate misses plac # pytest misses py # theanets misses plac -# xrootdpyfs misses from fs.errors import DestinationExistsError, DirectoryNotEmptyError, \ -#ImportError: cannot import name DestinationExistsError #hyperopt misses builtins #thriftpy misses ply -import importlib -err = 0 +#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 "Importing",i,".....", - try: - importlib.import_module(i) - print "Done" - except Exception as e: - print "Fail" - print traceback.format_exc() - err += 1 -sys.exit(err) + print i +# +# if i in skipIt: continue +# print "Importing",i,".....", +# d=Importer(i) +# err+=d.err() +# del d +# gc.collect() +# +#sys.exit(err) diff --git a/PhysicsTools/PythonAnalysis/test/imports.sh b/PhysicsTools/PythonAnalysis/test/imports.sh index 41a23cd40b136..4678f56a8a462 100755 --- a/PhysicsTools/PythonAnalysis/test/imports.sh +++ b/PhysicsTools/PythonAnalysis/test/imports.sh @@ -15,7 +15,11 @@ python -c 'import theano; print(theano.config)' echo ">>> Cleaning compile cache" theano-cache clear -python ${CMSSW_BASE}/src/PhysicsTools/PythonAnalysis/test/imports.py +for i in $(python ${CMSSW_BASE}/src/PhysicsTools/PythonAnalysis/test/imports.py) +do + echo "importing $i" + python -c "import $i" +done echo ">>> Cleaning compile cache" theano-cache clear