Skip to content

Commit

Permalink
changed approach
Browse files Browse the repository at this point in the history
  • Loading branch information
alfoa committed May 13, 2024
1 parent d3c7069 commit 7ff7659
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/library_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# some bad actors can't use the metadata correctly
# and so need special treatment
# -> see findLibAndVersion
metaExceptions = ['pyside2', 'AMSC', 'PIL', 'cvxpy']
metaExceptions = ['pyside2', 'AMSC', 'PIL']

# load up the ravenrc if it's present
## TODO we only want to do this once, but does it need to get updated?
Expand Down Expand Up @@ -170,6 +170,9 @@ def checkSingleLibrary(lib, version=None, useImportCheck=False):
## this avoids actually importing the modules
if usePackageMeta and not useImportCheck:
found, msg, foundVersion = findLibAndVersion(lib, version=version)
if not found:
# try slower approach
found, msg, foundVersion = findLibAndVersionSubprocess(lib, version=version)
# otherwise, use the slower subprocess method
else:
found, msg, foundVersion = findLibAndVersionSubprocess(lib, version=version)
Expand Down Expand Up @@ -215,8 +218,6 @@ def findLibAndVersion(lib, version=None):
return findLibAndVersionSubprocess('AMSC')
elif lib == 'PIL':
return findLibAndVersionSubprocess('PIL')
elif lib == 'cvxpy':
return findLibAndVersionSubprocess('cvxpy')
else:
raise NotImplementedError('Library "{}" on exception list, but no exception implemented!'.format(lib))
return found, output, foundVersion
Expand Down

0 comments on commit 7ff7659

Please sign in to comment.