Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.resolution.resolvelib.provider Namespace Reference

Data Structures

class  PipProvider
 

Functions

Union[D, V_get_with_identifier (Mapping[str, V] mapping, str identifier, D default)
 

Variables

 PreferenceInformation = RequirementInformation[Requirement, Candidate]
 
 _ProviderBase = AbstractProvider[Requirement, Candidate, str]
 
 D = TypeVar("D")
 
 V = TypeVar("V")
 

Function Documentation

◆ _get_with_identifier()

Union[D, V] _get_with_identifier ( Mapping[str, V mapping,
str  identifier,
D  default 
)
protected
Get item from a package name lookup mapping with a resolver identifier.

This extra logic is needed when the target mapping is keyed by package
name, which cannot be directly looked up with an identifier (which may
contain requested extras). Additional logic is added to also look up a value
by "cleaning up" the extras from the identifier.

Definition at line 53 of file provider.py.

57) -> Union[D, V]:
58 """Get item from a package name lookup mapping with a resolver identifier.
59
60 This extra logic is needed when the target mapping is keyed by package
61 name, which cannot be directly looked up with an identifier (which may
62 contain requested extras). Additional logic is added to also look up a value
63 by "cleaning up" the extras from the identifier.
64 """
65 if identifier in mapping:
66 return mapping[identifier]
67 # HACK: Theoretically we should check whether this identifier is a valid
68 # "NAME[EXTRAS]" format, and parse out the name part with packaging or
69 # some regular expression. But since pip's resolver only spits out three
70 # kinds of identifiers: normalized PEP 503 names, normalized names plus
71 # extras, and Requires-Python, we can cheat a bit here.
72 name, open_bracket, _ = identifier.partition("[")
73 if open_bracket and name in mapping:
74 return mapping[name]
75 return default
76
77
for i

References i.

Referenced by PipProvider.find_matches().

Here is the caller graph for this function:

Variable Documentation

◆ _ProviderBase

_ProviderBase = AbstractProvider[Requirement, Candidate, str]
protected

Definition at line 26 of file provider.py.

◆ D

D = TypeVar("D")

Definition at line 49 of file provider.py.

◆ PreferenceInformation

PreferenceInformation = RequirementInformation[Requirement, Candidate]

Definition at line 24 of file provider.py.

◆ V

V = TypeVar("V")

Definition at line 50 of file provider.py.