38
38
logger = logging .getLogger (__name__ )
39
39
40
40
41
- def make_install_req_from_link (link , parent ):
41
+ def make_install_req_from_link (link , template ):
42
42
# type: (Link, InstallRequirement) -> InstallRequirement
43
- assert not parent .editable , "parent is editable"
44
- if parent .req :
45
- line = str (parent .req )
43
+ assert not template .editable , "template is editable"
44
+ if template .req :
45
+ line = str (template .req )
46
46
else :
47
47
line = link .url
48
48
ireq = install_req_from_line (
49
49
line ,
50
- comes_from = parent .comes_from ,
51
- use_pep517 = parent .use_pep517 ,
52
- isolated = parent .isolated ,
53
- constraint = parent .constraint ,
50
+ comes_from = template .comes_from ,
51
+ use_pep517 = template .use_pep517 ,
52
+ isolated = template .isolated ,
53
+ constraint = template .constraint ,
54
54
options = dict (
55
- install_options = parent .install_options ,
56
- global_options = parent .global_options ,
57
- hashes = parent .hash_options
55
+ install_options = template .install_options ,
56
+ global_options = template .global_options ,
57
+ hashes = template .hash_options
58
58
),
59
59
)
60
60
if ireq .link is None :
@@ -63,42 +63,42 @@ def make_install_req_from_link(link, parent):
63
63
return ireq
64
64
65
65
66
- def make_install_req_from_editable (link , parent ):
66
+ def make_install_req_from_editable (link , template ):
67
67
# type: (Link, InstallRequirement) -> InstallRequirement
68
- assert parent .editable , "parent not editable"
68
+ assert template .editable , "template not editable"
69
69
return install_req_from_editable (
70
70
link .url ,
71
- comes_from = parent .comes_from ,
72
- use_pep517 = parent .use_pep517 ,
73
- isolated = parent .isolated ,
74
- constraint = parent .constraint ,
71
+ comes_from = template .comes_from ,
72
+ use_pep517 = template .use_pep517 ,
73
+ isolated = template .isolated ,
74
+ constraint = template .constraint ,
75
75
options = dict (
76
- install_options = parent .install_options ,
77
- global_options = parent .global_options ,
78
- hashes = parent .hash_options
76
+ install_options = template .install_options ,
77
+ global_options = template .global_options ,
78
+ hashes = template .hash_options
79
79
),
80
80
)
81
81
82
82
83
- def make_install_req_from_dist (dist , parent ):
83
+ def make_install_req_from_dist (dist , template ):
84
84
# type: (Distribution, InstallRequirement) -> InstallRequirement
85
85
project_name = canonicalize_name (dist .project_name )
86
- if parent .req :
87
- line = str (parent .req )
88
- elif parent .link :
89
- line = "{} @ {}" .format (project_name , parent .link .url )
86
+ if template .req :
87
+ line = str (template .req )
88
+ elif template .link :
89
+ line = "{} @ {}" .format (project_name , template .link .url )
90
90
else :
91
91
line = "{}=={}" .format (project_name , dist .parsed_version )
92
92
ireq = install_req_from_line (
93
93
line ,
94
- comes_from = parent .comes_from ,
95
- use_pep517 = parent .use_pep517 ,
96
- isolated = parent .isolated ,
97
- constraint = parent .constraint ,
94
+ comes_from = template .comes_from ,
95
+ use_pep517 = template .use_pep517 ,
96
+ isolated = template .isolated ,
97
+ constraint = template .constraint ,
98
98
options = dict (
99
- install_options = parent .install_options ,
100
- global_options = parent .global_options ,
101
- hashes = parent .hash_options
99
+ install_options = template .install_options ,
100
+ global_options = template .global_options ,
101
+ hashes = template .hash_options
102
102
),
103
103
)
104
104
ireq .satisfied_by = dist
@@ -236,7 +236,7 @@ class LinkCandidate(_InstallRequirementBackedCandidate):
236
236
def __init__ (
237
237
self ,
238
238
link , # type: Link
239
- parent , # type: InstallRequirement
239
+ template , # type: InstallRequirement
240
240
factory , # type: Factory
241
241
name = None , # type: Optional[str]
242
242
version = None , # type: Optional[_BaseVersion]
@@ -246,11 +246,11 @@ def __init__(
246
246
if cache_entry is not None :
247
247
logger .debug ("Using cached wheel link: %s" , cache_entry .link )
248
248
link = cache_entry .link
249
- ireq = make_install_req_from_link (link , parent )
249
+ ireq = make_install_req_from_link (link , template )
250
250
251
251
if (cache_entry is not None and
252
252
cache_entry .persistent and
253
- parent .link is parent .original_link ):
253
+ template .link is template .original_link ):
254
254
ireq .original_link_is_in_wheel_cache = True
255
255
256
256
super (LinkCandidate , self ).__init__ (
@@ -270,15 +270,15 @@ class EditableCandidate(_InstallRequirementBackedCandidate):
270
270
def __init__ (
271
271
self ,
272
272
link , # type: Link
273
- parent , # type: InstallRequirement
273
+ template , # type: InstallRequirement
274
274
factory , # type: Factory
275
275
name = None , # type: Optional[str]
276
276
version = None , # type: Optional[_BaseVersion]
277
277
):
278
278
# type: (...) -> None
279
279
super (EditableCandidate , self ).__init__ (
280
280
link = link ,
281
- ireq = make_install_req_from_editable (link , parent ),
281
+ ireq = make_install_req_from_editable (link , template ),
282
282
factory = factory ,
283
283
name = name ,
284
284
version = version ,
@@ -295,12 +295,12 @@ class AlreadyInstalledCandidate(Candidate):
295
295
def __init__ (
296
296
self ,
297
297
dist , # type: Distribution
298
- parent , # type: InstallRequirement
298
+ template , # type: InstallRequirement
299
299
factory , # type: Factory
300
300
):
301
301
# type: (...) -> None
302
302
self .dist = dist
303
- self ._ireq = make_install_req_from_dist (dist , parent )
303
+ self ._ireq = make_install_req_from_dist (dist , template )
304
304
self ._factory = factory
305
305
306
306
# This is just logging some messages, so we can do it eagerly.
0 commit comments