def provider( dspec, available_components, search_dirs, working_directory, update_if_installed, dep_of_name=None ): r = None try: r = access.satisfyVersionFromAvailable(dspec.name, dspec.version_req, available_components) except access_common.SpecificationNotMet as e: logger.error('%s (when trying to find %s for %s)' % (str(e), dspec, dep_of_name)) if r: if r.isTestDependency() and not dspec.is_test_dependency: logger.debug('test dependency subsequently occurred as real dependency: %s', dspec.name) r.setTestDependency(False) return r r = access.satisfyVersionFromSearchPaths(dspec.name, dspec.version_req, search_dirs, update_if_installed) if r: r.setTestDependency(dspec.is_test_dependency) return r r = access.satisfyVersionByInstalling(dspec.name, dspec.version_req, self.modulesPath()) if not r: logger.error('could not install %s' % name) if r is not None: r.setTestDependency(dspec.is_test_dependency) return r
def provider( dspec, available_components, search_dirs, working_directory, update_installed, dep_of=None ): r = access.satisfyFromAvailable(dspec.name, available_components) if r: if r.isTestDependency() and not dspec.is_test_dependency: logger.debug('test dependency subsequently occurred as real dependency: %s', r.getName()) r.setTestDependency(False) return r update_if_installed = False if update_installed is True: update_if_installed = True elif update_installed: update_if_installed = dspec.name in update_installed r = access.satisfyVersionFromSearchPaths( dspec.name, dspec.versionReq(), search_dirs, update_if_installed, inherit_shrinkwrap = dep_of.getShrinkwrap() ) if r: r.setTestDependency(dspec.is_test_dependency) return r # before resorting to install this module, check if we have an # existing linked module (which wasn't picked up because it didn't # match the version specification) - if we do, then we shouldn't # try to install, but should return that anyway: default_path = os.path.join(self.modulesPath(), dspec.name) if fsutils.isLink(default_path): r = Component( default_path, test_dependency = dspec.is_test_dependency, installed_linked = fsutils.isLink(default_path), inherit_shrinkwrap = dep_of.getShrinkwrap() ) if r: assert(r.installedLinked()) return r else: logger.error('linked module %s is invalid: %s', dspec.name, r.getError()) return r r = access.satisfyVersionByInstalling( dspec.name, dspec.versionReq(), self.modulesPath(), inherit_shrinkwrap = dep_of.getShrinkwrap() ) if not r: logger.error('could not install %s' % dspec.name) if r is not None: r.setTestDependency(dspec.is_test_dependency) return r
def provider( dspec, available_components, search_dirs, working_directory, update_installed, dep_of_name=None ): r = access.satisfyFromAvailable(dspec.name, available_components) if r: if r.isTestDependency() and not dspec.is_test_dependency: logger.debug('test dependency subsequently occurred as real dependency: %s', r.getName()) r.setTestDependency(False) return r update_if_installed = False if update_installed is True: update_if_installed = True elif update_installed: update_if_installed = dspec.name in update_installed r = access.satisfyVersionFromSearchPaths(dspec.name, dspec.version_req, search_dirs, update_if_installed) if r: r.setTestDependency(dspec.is_test_dependency) return r # before resorting to install this module, check if we have an # existing linked module (which wasn't picked up because it didn't # match the version specification) - if we do, then we shouldn't # try to install, but should return that anyway: default_path = os.path.join(self.modulesPath(), dspec.name) if fsutils.isLink(default_path): r = Component( default_path, test_dependency = dspec.is_test_dependency, installed_linked = fsutils.isLink(default_path) ) if r: assert(r.installedLinked()) return r else: logger.error('linked module %s is invalid: %s', dspec.name, r.getError()) return r r = access.satisfyVersionByInstalling(dspec.name, dspec.version_req, self.modulesPath()) if not r: logger.error('could not install %s' % dspec.name) if r is not None: r.setTestDependency(dspec.is_test_dependency) return r
def provider(name, version_req, available_components, search_dirs, working_directory, update_if_installed): r = None try: r = access.satisfyVersionFromAvailble(name, version_req, available_components) except access_common.SpecificationNotMet as e: logger.error('%s (when trying to find dependencies for %s)' % (str(e), self.getName())) if r: return r r = access.satisfyVersionFromSearchPaths(name, version_req, search_dirs, update_if_installed) if r: return r r = access.satisfyVersionByInstalling(name, version_req, self.modulesPath()) if not r: logger.error('could not install %s' % name) return r
def provider( dspec, available_components, search_dirs, working_directory, update_if_installed, dep_of_name=None ): r = access.satisfyFromAvailable(dspec.name, available_components) if r: if r.isTestDependency() and not dspec.is_test_dependency: logger.debug('test dependency subsequently occurred as real dependency: %s', r.getName()) r.setTestDependency(False) return r r = access.satisfyVersionFromSearchPaths(dspec.name, dspec.version_req, search_dirs, update_if_installed) if r: r.setTestDependency(dspec.is_test_dependency) return r r = access.satisfyVersionByInstalling(dspec.name, dspec.version_req, self.modulesPath()) if not r: logger.error('could not install %s' % name) if r is not None: r.setTestDependency(dspec.is_test_dependency) return r