本文整理匯總了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,
)