def _find_best_version_for_package(self, name, required_version=None ) -> Tuple[str, str]: selector = VersionSelector(self.poetry.pool) package = selector.find_best_candidate(name, required_version) if not package: # TODO: find similar raise ValueError( f'Could not find a matching version of package {name}') return (package.pretty_name, selector.find_recommended_require_version(package))
def _find_best_version_for_package( self, name, required_version=None): # type: (...) -> Tuple[str, str] from poetry.version.version_selector import VersionSelector selector = VersionSelector(self.poetry.pool) package = selector.find_best_candidate(name, required_version) if not package: # TODO: find similar raise ValueError( 'Could not find a matching version of package {}'.format(name)) return (package.pretty_name, selector.find_recommended_require_version(package))
def _find_best_version_for_package( self, name, required_version=None, allow_prereleases=False ): # type: (...) -> Tuple[str, str] from poetry.version.version_selector import VersionSelector selector = VersionSelector(self._get_pool()) package = selector.find_best_candidate( name, required_version, allow_prereleases=allow_prereleases ) if not package: # TODO: find similar raise ValueError( "Could not find a matching version of package {}".format(name) ) return (package.pretty_name, selector.find_recommended_require_version(package))
def _find_best_version_for_package( self, name, required_version=None, allow_prereleases=False, source=None ): # type: (...) -> Tuple[str, str] from poetry.version.version_selector import VersionSelector selector = VersionSelector(self._get_pool()) package = selector.find_best_candidate( name, required_version, allow_prereleases=allow_prereleases, source=source ) if not package: # TODO: find similar raise ValueError( "Could not find a matching version of package {}".format(name) ) return package.pretty_name, selector.find_recommended_require_version(package)
def _find_best_version_for_package( self, name: str, required_version: Optional[str] = None, allow_prereleases: bool = False, source: Optional[str] = None, ) -> Tuple[str, str]: from poetry.version.version_selector import VersionSelector selector = VersionSelector(self._get_pool()) package = selector.find_best_candidate( name, required_version, allow_prereleases=allow_prereleases, source=source ) if not package: # TODO: find similar raise ValueError(f"Could not find a matching version of package {name}") return package.pretty_name, selector.find_recommended_require_version(package)