@@ -662,6 +662,27 @@ MarkupSafe==2.0.1
662662 Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not install build-time dependency wheel: some-pip-error" ))
663663 })
664664 })
665+
666+ Context ("poetry-core preparation fails" , func () {
667+ It ("returns a useful error message" , func () {
668+ mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
669+ 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" )
670+ 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" )
671+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" ).Return (fmt .Errorf ("prepare-error" ))
672+ Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not prepare build-time dependency poetry-core: prepare-error" ))
673+ })
674+ })
675+
676+ Context ("poetry-core bootstrap fails" , func () {
677+ It ("returns a useful error message" , func () {
678+ mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
679+ 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" )
680+ 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" )
681+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" )
682+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" ).Return (fmt .Errorf ("poetry-error" ))
683+ Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not bootstrap-install poetry-core: poetry-error" ))
684+ })
685+ })
665686 })
666687
667688 Describe ("CreateDefaultEnv" , func () {
0 commit comments