本文整理汇总了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,
)
示例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,
)
示例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,
)
示例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,
)
示例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)))
示例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,
)