@@ -206,8 +206,8 @@ def parse_req_from_editable(editable_req: str) -> RequirementParts:
206
206
if name is not None :
207
207
try :
208
208
req : Optional [Requirement ] = Requirement (name )
209
- except InvalidRequirement :
210
- raise InstallationError (f"Invalid requirement: ' { name } ' " )
209
+ except InvalidRequirement as exc :
210
+ raise InstallationError (f"Invalid requirement: { name !r } : { exc } " )
211
211
else :
212
212
req = None
213
213
@@ -360,7 +360,7 @@ def with_source(text: str) -> str:
360
360
def _parse_req_string (req_as_string : str ) -> Requirement :
361
361
try :
362
362
return get_requirement (req_as_string )
363
- except InvalidRequirement :
363
+ except InvalidRequirement as exc :
364
364
if os .path .sep in req_as_string :
365
365
add_msg = "It looks like a path."
366
366
add_msg += deduce_helpful_msg (req_as_string )
@@ -370,7 +370,7 @@ def _parse_req_string(req_as_string: str) -> Requirement:
370
370
add_msg = "= is not a valid operator. Did you mean == ?"
371
371
else :
372
372
add_msg = ""
373
- msg = with_source (f"Invalid requirement: { req_as_string !r} " )
373
+ msg = with_source (f"Invalid requirement: { req_as_string !r} : { exc } " )
374
374
if add_msg :
375
375
msg += f"\n Hint: { add_msg } "
376
376
raise InstallationError (msg )
@@ -429,8 +429,8 @@ def install_req_from_req_string(
429
429
) -> InstallRequirement :
430
430
try :
431
431
req = get_requirement (req_string )
432
- except InvalidRequirement :
433
- raise InstallationError (f"Invalid requirement: ' { req_string } ' " )
432
+ except InvalidRequirement as exc :
433
+ raise InstallationError (f"Invalid requirement: { req_string !r } : { exc } " )
434
434
435
435
domains_not_allowed = [
436
436
PyPI .file_storage_domain ,
0 commit comments