Skip to content

Commit 70bd7f6

Browse files
vanschelvenarjun024
authored andcommitted
Fix the tests
there is a small assymmetry between RunPipVendored and RunPipUnvendored's errror messages because the latter prepends 'could not run pip'; this became apparant in the tests because RunPipVendored no longer calls RunPipUnvendored. We've simply harmonized on 'could not run pip' and removed a call to pip from the tests (we no longer do that)
1 parent d7e5c1d commit 70bd7f6

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/python/supply/supply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ func (s *Supplier) RunPipVendored() error {
704704

705705
if err := s.runPipInstall(installArgs...); err != nil {
706706
s.Log.Info("Running pip install failed. You need to include all dependencies in the vendor directory.")
707-
return err
707+
return fmt.Errorf("could not run pip: %v", err)
708708
}
709709

710710
return s.Stager.LinkDirectoryInDepDir(filepath.Join(s.Stager.DepDir(), "python", "bin"), "bin")

src/python/supply/supply_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ MarkupSafe==2.0.1
631631
Expect(os.Mkdir(filepath.Join(buildDir, "vendor"), 0755)).To(Succeed())
632632
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "--no-build-isolation", "-h").Return(nil)
633633
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "-r", filepath.Join(buildDir, "requirements.txt"), "--ignore-installed", "--exists-action=w", fmt.Sprintf("--src=%s/src", depDir), "--no-index", fmt.Sprintf("--find-links=file://%s/vendor", buildDir), "--disable-pip-version-check", "--no-warn-script-location", "--no-build-isolation").Return(fmt.Errorf("exit 28"))
634-
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "-r", filepath.Join(buildDir, "requirements.txt"), "--ignore-installed", "--exists-action=w", fmt.Sprintf("--src=%s/src", depDir), "--disable-pip-version-check", "--no-warn-script-location").Return(fmt.Errorf("exit 28"))
635634
})
636635

637636
const proTip = "Running pip install failed. You need to include all dependencies in the vendor directory."

0 commit comments

Comments
 (0)