當前位置: 首頁>>代碼示例>>Python>>正文


Python index.PackageFinder方法代碼示例

本文整理匯總了Python中pip.index.PackageFinder方法的典型用法代碼示例。如果您正苦於以下問題:Python index.PackageFinder方法的具體用法?Python index.PackageFinder怎麽用?Python index.PackageFinder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pip.index的用法示例。


在下文中一共展示了index.PackageFinder方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _build_package_finder

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def _build_package_finder(self, options, session,
                              platform=None, python_versions=None,
                              abi=None, implementation=None):
        """
        Create a package finder appropriate to this requirement command.
        """
        index_urls = [options.index_url] + options.extra_index_urls
        if options.no_index:
            logger.debug('Ignoring indexes: %s', ','.join(index_urls))
            index_urls = []

        return PackageFinder(
            find_links=options.find_links,
            format_control=options.format_control,
            index_urls=index_urls,
            trusted_hosts=options.trusted_hosts,
            allow_all_prereleases=options.pre,
            process_dependency_links=options.process_dependency_links,
            session=session,
            platform=platform,
            versions=python_versions,
            abi=abi,
            implementation=implementation,
        ) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:26,代碼來源:basecommand.py

示例2: _build_package_finder

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def _build_package_finder(self, options, session):
        """
        Create a package finder appropriate to this requirement command.
        """
        index_urls = [options.index_url] + options.extra_index_urls
        if options.no_index:
            logger.info('Ignoring indexes: %s', ','.join(index_urls))
            index_urls = []

        return PackageFinder(
            find_links=options.find_links,
            format_control=options.format_control,
            index_urls=index_urls,
            trusted_hosts=options.trusted_hosts,
            allow_all_prereleases=options.pre,
            process_dependency_links=options.process_dependency_links,
            session=session,
        ) 
開發者ID:jpush,項目名稱:jbox,代碼行數:20,代碼來源:basecommand.py

示例3: _build_package_finder

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def _build_package_finder(self, options, index_urls, session):
        """
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        """
        return PackageFinder(find_links=options.find_links,
                             index_urls=index_urls,
                             use_wheel=options.use_wheel,
                             allow_external=options.allow_external,
                             allow_unverified=options.allow_unverified,
                             allow_all_external=options.allow_all_external,
                             allow_all_prereleases=options.pre,
                             process_dependency_links=
                                options.process_dependency_links,
                             session=session,
                            ) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:19,代碼來源:install.py

示例4: _build_package_finder

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def _build_package_finder(self, options, index_urls, session):
        """
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        """
        return PackageFinder(
            find_links=options.find_links,
            format_control=options.format_control,
            index_urls=index_urls,
            allow_external=options.allow_external,
            allow_unverified=options.allow_unverified,
            allow_all_external=options.allow_all_external,
            trusted_hosts=options.trusted_hosts,
            allow_all_prereleases=options.pre,
            process_dependency_links=options.process_dependency_links,
            session=session,
        ) 
開發者ID:chalasr,項目名稱:Flask-P2P,代碼行數:20,代碼來源:install.py

示例5: run

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def run(self, package_name):

        # PackageFinder requires session which requires options

        options, args = self.parse_args([])
        session = self._build_session(options=options)
        
        finder = PackageFinder(
            find_links=[],
            index_urls=['https://pypi.python.org/simple/'],
            session=session,
        )
       
        candidates = finder.find_all_candidates(package_name)
        
        # set() to remove repeated versions - ie. matplotlib
        versions = sorted(set(c.version for c in candidates))
        
        print('\n'.join(map(str, versions))) 
開發者ID:furas,項目名稱:python-examples,代碼行數:21,代碼來源:pip-all-versions.py

示例6: _build_package_finder

# 需要導入模塊: from pip import index [as 別名]
# 或者: from pip.index import PackageFinder [as 別名]
def _build_package_finder(self, options, index_urls, session):
        """
        Create a package finder appropriate to this list command.
        """
        return PackageFinder(
            find_links=options.find_links,
            index_urls=index_urls,
            allow_all_prereleases=options.pre,
            trusted_hosts=options.trusted_hosts,
            process_dependency_links=options.process_dependency_links,
            session=session,
        ) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:14,代碼來源:list.py


注:本文中的pip.index.PackageFinder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。