def checkLibraries(buildReport=False): """ Looks for required libraries, and their matching QA versions. @ In, buildReport, bool, optional, if True then report all libraries instead of just problems @ Out, missing, list(tuple(str, str)), list of missing libraries and needed versions @ Out, notQA, list(tuple(str, str, str)), mismatched versions as (libs, need version, found version) """ missing = [] # libraries that are not present, that should be notQA = [] # libraries that are not the correct version, but are present plugins = pluginHandler.getInstalledPlugins() need = getRequiredLibs(plugins=plugins) messages = [] for lib, request in need.items(): # some libs aren't checked from within python if request['skip_check']: continue needVersion = request['version'] found, msg, foundVersion = checkSingleLibrary(lib, version=needVersion) if not found: missing.append((lib, needVersion)) continue if needVersion is not None and foundVersion != needVersion: notQA.append((lib, needVersion, foundVersion)) if buildReport: messages.append((lib, found, msg, foundVersion)) if buildReport: return messages return missing, notQA
sourceDir)) for e in msgs: print(' ', e) print(' Skipping plugin installation.') returnCode += 1 failedSources.append(sourceDir) if args.full_copy: # TODO: copy the files # register the plugin in the plugin_directory as being in the plugins folder raise NotImplementedError infoFile, root = pluginHandler.loadPluginTree() # add or update plugins from sources installed = pluginHandler.getInstalledPlugins() if installed: existing, _ = zip(*installed) else: existing = [] print('Installing plugins ...') for plugDir in sources: name = os.path.basename(plugDir) if name in existing: match = pluginHandler.updatePluginXML(root, name, plugDir) print(' ... plugin "{}" path updated to "{}" ...'.format( name, plugDir)) else: # create a new entry new = pluginHandler.writeNewPluginXML(name, plugDir) print(' ... plugin "{}" path created as "{}" ...'.format(