From e116245f8e6a4692d3f1112e962b04d1028cd652 Mon Sep 17 00:00:00 2001 From: Bart Schuurmans Date: Wed, 14 Aug 2024 21:12:00 +0200 Subject: [PATCH] Replace poetry update with poetry install `poetry update` is a command that upgrades all dependecies to their latest compatible version. This is never what you want when just installing dependencies. Instead, `poetry install` should be run to install the dependency versions specified in the lock file. This fixes the behavior of Frogbot upgrading all dependencies when called in CI. --- utils/python/utils.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/python/utils.go b/utils/python/utils.go index 7a599b28a..e9766c4f3 100644 --- a/utils/python/utils.go +++ b/utils/python/utils.go @@ -89,15 +89,15 @@ func ConfigPoetryRepo(url, username, password, configRepoName string) error { if err = addRepoToPyprojectFile(filepath.Join(currentDir, pyproject), configRepoName, url); err != nil { return err } - return poetryUpdate() + return poetryInstall() } -func poetryUpdate() (err error) { - log.Info("Running Poetry update") - cmd := io.NewCommand("poetry", "update", []string{}) +func poetryInstall() (err error) { + log.Info("Running Poetry install") + cmd := io.NewCommand("poetry", "install", []string{}) err = gofrogcmd.RunCmd(cmd) if err != nil { - return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error()) + return errorutils.CheckErrorf("Poetry install command failed with: %s", err.Error()) } return }