@@ -633,10 +633,12 @@ MarkupSafe==2.0.1
633633
634634 Describe ("InstallCommonBuildDependencies" , func () {
635635 Context ("successful installation" , func () {
636- It ("runs command to install wheel and setuptools " , func () {
636+ It ("runs command to install wheel, setuptools and poetry-core " , func () {
637637 mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
638638 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "wheel" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
639639 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "setuptools" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
640+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" )
641+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
640642
641643 Expect (supplier .InstallCommonBuildDependencies ()).To (Succeed ())
642644 })
@@ -652,6 +654,27 @@ MarkupSafe==2.0.1
652654 Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not install build-time dependency wheel: some-pip-error" ))
653655 })
654656 })
657+
658+ Context ("poetry-core preparation fails" , func () {
659+ It ("returns a useful error message" , func () {
660+ mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
661+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "wheel" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
662+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "setuptools" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
663+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" ).Return (fmt .Errorf ("prepare-error" ))
664+ Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not prepare build-time dependency poetry-core: prepare-error" ))
665+ })
666+ })
667+
668+ Context ("poetry-core bootstrap fails" , func () {
669+ It ("returns a useful error message" , func () {
670+ mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
671+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "wheel" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
672+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "setuptools" , "--no-index" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
673+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" )
674+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" ).Return (fmt .Errorf ("poetry-error" ))
675+ Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not bootstrap-install poetry-core: poetry-error" ))
676+ })
677+ })
655678 })
656679
657680 Describe ("CreateDefaultEnv" , func () {
0 commit comments