@@ -277,34 +277,19 @@ def with_source(text):
277
277
'archives' .format (name ) + deduce_helpful_msg (p )
278
278
)
279
279
280
- # it's a local file, dir, or url
281
- if link :
282
- # wheel file
283
- if link .is_wheel :
284
- wheel = Wheel (link .filename ) # can raise InvalidWheelFilename
285
- req_as_string = "%s==%s" % (wheel .name , wheel .version )
286
- else :
287
- # set the req to the egg fragment. when it's not there, this
288
- # will become an 'unnamed' requirement
289
- req_as_string = link .egg_fragment
290
-
291
- # a requirement specifier
292
- else :
293
- req_as_string = name
294
-
295
280
if extras_as_string :
296
281
extras = Requirement ("placeholder" + extras_as_string .lower ()).extras
297
282
else :
298
283
extras = ()
299
- if req_as_string is not None :
284
+ # wheel file
285
+ if link and link .is_wheel :
286
+ wheel = Wheel (link .filename ) # can raise InvalidWheelFilename
287
+ wheel_req = "%s==%s" % (wheel .name , wheel .version )
300
288
try :
301
- _req = Requirement (req_as_string )
289
+ req . requirement = Requirement (wheel_req )
302
290
except InvalidRequirement :
303
- # !under construction! this section being moved above
304
- msg = ''
305
- raise InstallationError (msg )
306
- else :
307
- _req = None
291
+ pass
292
+ requirement = req .requirement
308
293
309
294
return InstallRequirement (
310
295
req .requirement , comes_from , link = link , markers = markers ,
0 commit comments