@@ -513,34 +513,39 @@ def _install_directory(self, operation):
513
513
legacy_pip = self ._env .pip_version < self ._env .pip_version .__class__ (
514
514
19 , 0 , 0
515
515
)
516
- package_poetry = Factory ().create_poetry (pyproject .file .path .parent )
517
516
518
- if package .develop and not package_poetry .package .build_script :
519
- from poetry .masonry .builders .editable import EditableBuilder
517
+ try :
518
+ package_poetry = Factory ().create_poetry (pyproject .file .path .parent )
519
+ except RuntimeError :
520
+ package_poetry = None
520
521
521
- # This is a Poetry package in editable mode
522
- # we can use the EditableBuilder without going through pip
523
- # to install it, unless it has a build script.
524
- builder = EditableBuilder (package_poetry , self ._env , NullIO ())
525
- builder .build ()
522
+ if package_poetry is not None :
523
+ if package .develop and not package_poetry .package .build_script :
524
+ from poetry .masonry .builders .editable import EditableBuilder
526
525
527
- return 0
528
- elif legacy_pip or package_poetry .package .build_script :
529
- from poetry .core .masonry .builders .sdist import SdistBuilder
526
+ # This is a Poetry package in editable mode
527
+ # we can use the EditableBuilder without going through pip
528
+ # to install it, unless it has a build script.
529
+ builder = EditableBuilder (package_poetry , self ._env , NullIO ())
530
+ builder .build ()
531
+
532
+ return 0
533
+ elif legacy_pip or package_poetry .package .build_script :
534
+ from poetry .core .masonry .builders .sdist import SdistBuilder
530
535
531
- # We need to rely on creating a temporary setup.py
532
- # file since the version of pip does not support
533
- # build-systems
534
- # We also need it for non-PEP-517 packages
535
- builder = SdistBuilder (package_poetry )
536
+ # We need to rely on creating a temporary setup.py
537
+ # file since the version of pip does not support
538
+ # build-systems
539
+ # We also need it for non-PEP-517 packages
540
+ builder = SdistBuilder (package_poetry )
536
541
537
- with builder .setup_py ():
538
- if package .develop :
539
- args .append ("-e" )
542
+ with builder .setup_py ():
543
+ if package .develop :
544
+ args .append ("-e" )
540
545
541
- args .append (req )
546
+ args .append (req )
542
547
543
- return self .run_pip (* args )
548
+ return self .run_pip (* args )
544
549
545
550
if package .develop :
546
551
args .append ("-e" )
0 commit comments