File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -239,24 +239,25 @@ def with_source(text):
239
239
240
240
link = req .link
241
241
242
+ def get_install_error (text ):
243
+ return InstallationError (with_source (text ))
244
+
242
245
if link and link .scheme == 'file' :
243
246
p = link .path
244
247
if not os .path .exists (p ):
245
- raise InstallationError (
246
- with_source (
247
- "Requirement '{}' looks like a path, but the "
248
- 'file/directory does not exist' .format (name )
249
- )
248
+ raise get_install_error (
249
+ "Requirement '{}' looks like a path, but the "
250
+ 'file/directory does not exist' .format (name )
250
251
)
251
252
252
253
if os .path .isdir (p ):
253
254
if not is_installable_dir (p ):
254
- raise InstallationError (
255
+ raise get_install_error (
255
256
"Directory %r is not installable. Neither 'setup.py' "
256
- "nor 'pyproject.toml' found." % name
257
+ "nor 'pyproject.toml' found." . format ( name )
257
258
)
258
259
elif not is_archive_file (p ) and not link .is_wheel :
259
- raise InstallationError (
260
+ raise get_install_error (
260
261
"Invalid requirement: {!r}, files must be wheels or "
261
262
'archives' .format (name ) + deduce_helpful_msg (p )
262
263
)
You can’t perform that action at this time.
0 commit comments