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

Data Structures

class  _InstallRequirementBackedCandidate
 
class  AlreadyInstalledCandidate
 
class  EditableCandidate
 
class  ExtrasCandidate
 
class  LinkCandidate
 
class  RequiresPythonCandidate
 

Functions

Optional[BaseCandidateas_base_candidate (Candidate candidate)
 
InstallRequirement make_install_req_from_link (Link link, InstallRequirement template)
 
InstallRequirement make_install_req_from_editable (Link link, InstallRequirement template)
 
InstallRequirement _make_install_req_from_dist (BaseDistribution dist, InstallRequirement template)
 

Variables

 logger = logging.getLogger(__name__)
 
 BaseCandidate
 
 REQUIRES_PYTHON_IDENTIFIER = cast(NormalizedName, "<Python from Requires-Python>")
 

Function Documentation

◆ _make_install_req_from_dist()

InstallRequirement _make_install_req_from_dist ( BaseDistribution  dist,
InstallRequirement   template 
)
protected

Definition at line 98 of file candidates.py.

100) -> InstallRequirement:
101 if template.req:
102 line = str(template.req)
103 elif template.link:
104 line = f"{dist.canonical_name} @ {template.link.url}"
105 else:
106 line = f"{dist.canonical_name}=={dist.version}"
107 ireq = install_req_from_line(
108 line,
109 user_supplied=template.user_supplied,
110 comes_from=template.comes_from,
111 use_pep517=template.use_pep517,
112 isolated=template.isolated,
113 constraint=template.constraint,
114 global_options=template.global_options,
115 hash_options=template.hash_options,
116 config_settings=template.config_settings,
117 )
118 ireq.satisfied_by = dist
119 return ireq
120
121
for i

References i.

◆ as_base_candidate()

Optional[BaseCandidate] as_base_candidate ( Candidate  candidate)
The runtime version of BaseCandidate.

Definition at line 41 of file candidates.py.

41def as_base_candidate(candidate: Candidate) -> Optional[BaseCandidate]:
42 """The runtime version of BaseCandidate."""
43 base_candidate_classes = (
44 AlreadyInstalledCandidate,
45 EditableCandidate,
46 LinkCandidate,
47 )
48 if isinstance(candidate, base_candidate_classes):
49 return candidate
50 return None
51
52

References i.

◆ make_install_req_from_editable()

InstallRequirement make_install_req_from_editable ( Link  link,
InstallRequirement   template 
)

Definition at line 78 of file candidates.py.

80) -> InstallRequirement:
81 assert template.editable, "template not editable"
82 ireq = install_req_from_editable(
84 user_supplied=template.user_supplied,
85 comes_from=template.comes_from,
86 use_pep517=template.use_pep517,
87 isolated=template.isolated,
88 constraint=template.constraint,
89 permit_editable_wheels=template.permit_editable_wheels,
90 global_options=template.global_options,
91 hash_options=template.hash_options,
92 config_settings=template.config_settings,
93 )
95 return ireq
96
97

References i.

Referenced by EditableCandidate.__init__().

Here is the caller graph for this function:

◆ make_install_req_from_link()

InstallRequirement make_install_req_from_link ( Link  link,
InstallRequirement   template 
)

Definition at line 53 of file candidates.py.

55) -> InstallRequirement:
56 assert not template.editable, "template is editable"
57 if template.req:
58 line = str(template.req)
59 else:
60 line = link.url
61 ireq = install_req_from_line(
62 line,
63 user_supplied=template.user_supplied,
64 comes_from=template.comes_from,
65 use_pep517=template.use_pep517,
66 isolated=template.isolated,
67 constraint=template.constraint,
68 global_options=template.global_options,
69 hash_options=template.hash_options,
70 config_settings=template.config_settings,
71 )
73 ireq.link = link
75 return ireq
76
77

References i.

Referenced by LinkCandidate.__init__().

Here is the caller graph for this function:

Variable Documentation

◆ BaseCandidate

BaseCandidate
Initial value:
1= Union[
2 "AlreadyInstalledCandidate",
3 "EditableCandidate",
4 "LinkCandidate",
5]

Definition at line 31 of file candidates.py.

◆ logger

logger = logging.getLogger(__name__)

Definition at line 29 of file candidates.py.

◆ REQUIRES_PYTHON_IDENTIFIER

REQUIRES_PYTHON_IDENTIFIER = cast(NormalizedName, "<Python from Requires-Python>")

Definition at line 38 of file candidates.py.