From 02c309c151cb242846de790ce60710250e1212ea Mon Sep 17 00:00:00 2001 From: Cor Zuurmond Date: Tue, 30 Jul 2024 11:58:59 +0200 Subject: [PATCH] Add upgrade and upgrade eager flags to pip install call https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-U --- cmd/labs/project/installer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/labs/project/installer.go b/cmd/labs/project/installer.go index 39ed9a966e..041415964f 100644 --- a/cmd/labs/project/installer.go +++ b/cmd/labs/project/installer.go @@ -272,8 +272,10 @@ func (i *installer) installPythonDependencies(ctx context.Context, spec string) // - python3 -m ensurepip --default-pip // - curl -o https://bootstrap.pypa.io/get-pip.py | python3 var buf bytes.Buffer + // Ensure latest version(s) is installed with the `--upgrade` and `--upgrade-strategy eager` flags + // https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-U _, err := process.Background(ctx, - []string{i.virtualEnvPython(ctx), "-m", "pip", "install", spec}, + []string{i.virtualEnvPython(ctx), "-m", "pip", "install", "--upgrade", "--upgrade-strategy", "eager", spec}, process.WithCombinedOutput(&buf), process.WithDir(libDir)) if err != nil {