Skip to content

Commit 514324f

Browse files
Replace poetry update with poetry lock --no-update
`poetry update` is a command that upgrades all dependecies to their latest compatible version. Instead, `poetry lock --no-update` should be run after configuring the repository to update the lock file. This fixes the behavior of Frogbot upgrading all dependencies when called in CI.
1 parent 9f16036 commit 514324f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

utils/python/utils.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package utils
22

33
import (
44
"fmt"
5-
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
65
"net/url"
76
"os"
87
"path/filepath"
98
"strings"
109

10+
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
11+
1112
"github.com/jfrog/build-info-go/utils/pythonutils"
1213
"github.com/jfrog/gofrog/io"
1314
gofrogcmd "github.com/jfrog/gofrog/io"
@@ -89,15 +90,15 @@ func ConfigPoetryRepo(url, username, password, configRepoName string) error {
8990
if err = addRepoToPyprojectFile(filepath.Join(currentDir, pyproject), configRepoName, url); err != nil {
9091
return err
9192
}
92-
return poetryUpdate()
93+
return regeneratePoetryLock()
9394
}
9495

95-
func poetryUpdate() (err error) {
96-
log.Info("Running Poetry update")
97-
cmd := io.NewCommand("poetry", "update", []string{})
96+
func regeneratePoetryLock() (err error) {
97+
log.Info("Syncing Poetry lock file")
98+
cmd := io.NewCommand("poetry", "lock", []string{"--no-update"})
9899
err = gofrogcmd.RunCmd(cmd)
99100
if err != nil {
100-
return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error())
101+
return errorutils.CheckErrorf("Poetry lock command failed with: %s", err.Error())
101102
}
102103
return
103104
}

0 commit comments

Comments
 (0)