@@ -60,7 +60,8 @@ def install_given_reqs(
60
60
)
61
61
62
62
# pre allocate installed package names
63
- installed = [None ] * len (to_install ) # type: List[Any]
63
+ installed = \
64
+ [None ] * len (to_install ) # type: List[Optional[InstallationResult]]
64
65
65
66
install_args = [install_options , global_options , args , kwargs ]
66
67
@@ -92,7 +93,7 @@ def install_given_reqs(
92
93
93
94
def __single_install (
94
95
install_args , # type: List[Any]
95
- a_requirement , # type: InstallRequirement
96
+ requirement , # type: InstallRequirement
96
97
allow_raise = False # type: bool
97
98
):
98
99
# type: (...) -> Optional[InstallationResult]
@@ -101,32 +102,32 @@ def __single_install(
101
102
102
103
(to be called per requirement, either in parallel or serially)
103
104
"""
104
- if a_requirement .should_reinstall :
105
- logger .info ('Attempting uninstall: %s' , a_requirement .name )
105
+ if requirement .should_reinstall :
106
+ logger .info ('Attempting uninstall: %s' , requirement .name )
106
107
with indent_log ():
107
- uninstalled_pathset = a_requirement .uninstall (
108
+ uninstalled_pathset = requirement .uninstall (
108
109
auto_confirm = True
109
110
)
110
111
try :
111
- a_requirement .install (
112
+ requirement .install (
112
113
install_args [0 ], # install_options,
113
114
install_args [1 ], # global_options,
114
115
* install_args [2 ], # *args,
115
116
** install_args [3 ] # **kwargs
116
117
)
117
118
except Exception :
118
- should_rollback = (a_requirement .should_reinstall and
119
- not a_requirement .install_succeeded )
119
+ should_rollback = (requirement .should_reinstall and
120
+ not requirement .install_succeeded )
120
121
# if install did not succeed, rollback previous uninstall
121
122
if should_rollback :
122
123
uninstalled_pathset .rollback ()
123
124
if allow_raise :
124
125
raise
125
126
else :
126
- should_commit = (a_requirement .should_reinstall and
127
- a_requirement .install_succeeded )
127
+ should_commit = (requirement .should_reinstall and
128
+ requirement .install_succeeded )
128
129
if should_commit :
129
130
uninstalled_pathset .commit ()
130
- return InstallationResult (a_requirement .name )
131
+ return InstallationResult (requirement .name )
131
132
132
133
return None
0 commit comments