Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Classes | Functions | Variables
pip._internal.index.package_finder Namespace Reference

Classes

class  BestCandidateResult
 
class  CandidateEvaluator
 
class  CandidatePreferences
 
class  LinkEvaluator
 
class  LinkType
 
class  PackageFinder
 

Functions

bool _check_link_requires_python (Link link, Tuple[int, int, int] version_info, bool ignore_requires_python=False)
 
List[InstallationCandidatefilter_unallowed_hashes (List[InstallationCandidate] candidates, Optional[Hashes] hashes, str project_name)
 
int _find_name_version_sep (str fragment, str canonical_name)
 
Optional[str] _extract_version_from_fragment (str fragment, str canonical_name)
 

Variables

 logger = getLogger(__name__)
 
 BuildTag = Union[Tuple[()], Tuple[int, str]]
 
 CandidateSortingKey = Tuple[int, int, int, _BaseVersion, Optional[int], BuildTag]
 

Detailed Description

Routines related to PyPI, indexes

Function Documentation

◆ _check_link_requires_python()

bool pip._internal.index.package_finder._check_link_requires_python ( Link  link,
Tuple[int, int, int]  version_info,
bool   ignore_requires_python = False 
)
protected
Return whether the given Python version is compatible with a link's
"Requires-Python" value.

:param version_info: A 3-tuple of ints representing the Python
    major-minor-micro version to check.
:param ignore_requires_python: Whether to ignore the "Requires-Python"
    value if the given Python version isn't compatible.

◆ _extract_version_from_fragment()

Optional[str] pip._internal.index.package_finder._extract_version_from_fragment ( str  fragment,
str  canonical_name 
)
protected
Parse the version string from a <package>+<version> filename
"fragment" (stem) or egg fragment.

:param fragment: The string to parse. E.g. foo-2.1
:param canonical_name: The canonicalized name of the package this
    belongs to.

◆ _find_name_version_sep()

int pip._internal.index.package_finder._find_name_version_sep ( str  fragment,
str  canonical_name 
)
protected
Find the separator's index based on the package's canonical name.

:param fragment: A <package>+<version> filename "fragment" (stem) or
    egg fragment.
:param canonical_name: The package's canonical name.

This function is needed since the canonicalized name does not necessarily
have the same length as the egg info's name part. An example::

>>> fragment = 'foo__bar-1.0'
>>> canonical_name = 'foo-bar'
>>> _find_name_version_sep(fragment, canonical_name)
8

◆ filter_unallowed_hashes()

List[InstallationCandidate] pip._internal.index.package_finder.filter_unallowed_hashes ( List[InstallationCandidate candidates,
Optional[Hashes hashes,
str  project_name 
)
Filter out candidates whose hashes aren't allowed, and return a new
list of candidates.

If at least one candidate has an allowed hash, then all candidates with
either an allowed hash or no hash specified are returned.  Otherwise,
the given candidates are returned.

Including the candidates with no hash specified when there is a match
allows a warning to be logged if there is a more preferred candidate
with no hash specified.  Returning all candidates in the case of no
matches lets pip report the hash of the candidate that would otherwise
have been installed (e.g. permitting the user to more easily update
their requirements file with the desired hash).