@@ -633,31 +633,56 @@ MarkupSafe==2.0.1
633633
634634 Describe ("InstallCommonBuildDependencies" , func () {
635635 Context ("successful installation" , func () {
636- It ("bootstraps flit-core, wheel and setuptools" , func () {
636+ It ("bootstraps flit-core, poetry-core, wheel and setuptools" , func () {
637637 mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
638638 mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
639639 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
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 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "wheel" , "--no-index" , "--no-build-isolation" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
641643 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "setuptools" , "--no-index" , "--no-build-isolation" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" )
642644
643645 Expect (supplier .InstallCommonBuildDependencies ()).To (Succeed ())
644646 })
645647 })
646648
647- Context ("flit-core bootstrap fails" , func () {
648- It ("returns a useful error message" , func () {
649- mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
650- mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
651- mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" ).Return (fmt .Errorf ("bootstrap-error" ))
652- Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not bootstrap-install flit-core: bootstrap-error" ))
649+ Context ("flit-core bootstrap fails" , func () {
650+ It ("returns a useful error message" , func () {
651+ mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
652+ mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
653+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" ).Return (fmt .Errorf ("bootstrap-error" ))
654+ Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not bootstrap-install flit-core: bootstrap-error" ))
655+ })
656+ })
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+ mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
662+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
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+ mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
672+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
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+ })
653677 })
654- })
655678
656679 Context ("wheel installation fails" , func () {
657680 It ("returns a useful error message" , func () {
658681 mockInstaller .EXPECT ().InstallOnlyVersion ("pip" , "/tmp/common_build_deps" )
659682 mockInstaller .EXPECT ().InstallOnlyVersion ("flit-core" , "/tmp/common_build_deps" )
660683 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
684+ mockInstaller .EXPECT ().InstallOnlyVersion ("poetry-core" , "/tmp/common_build_deps" )
685+ mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "/tmp/common_build_deps" , "--no-build-isolation" )
661686 mockCommand .EXPECT ().Execute (buildDir , gomock .Any (), gomock .Any (), "python" , "-m" , "pip" , "install" , "wheel" , "--no-index" , "--no-build-isolation" , "--upgrade-strategy=only-if-needed" , "--find-links=/tmp/common_build_deps" ).Return (fmt .Errorf ("some-pip-error" ))
662687 Expect (supplier .InstallCommonBuildDependencies ()).To (MatchError ("could not install build-time dependency wheel: some-pip-error" ))
663688 })
0 commit comments