Skip to content

Commit

Permalink
Fix poetry failing test (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Mar 11, 2024
1 parent 685c9c3 commit 1c2769b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions utils/python/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ func ConfigPoetryRepo(url, username, password, configRepoName string) error {
if err != nil {
return errorutils.CheckError(err)
}
return addRepoToPyprojectFile(filepath.Join(currentDir, pyproject), configRepoName, url)
if err = addRepoToPyprojectFile(filepath.Join(currentDir, pyproject), configRepoName, url); err != nil {
return err
}
return poetryUpdate()
}

func poetryUpdate() (err error) {
log.Info("Running Poetry update")
cmd := io.NewCommand("poetry", "update", []string{})
err = gofrogcmd.RunCmd(cmd)
if err != nil {
return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error())
}
return
}

func runPoetryConfigCommand(args []string, maskArgs bool) error {
Expand Down Expand Up @@ -113,11 +126,5 @@ func addRepoToPyprojectFile(filepath, poetryRepoName, repoUrl string) error {
return errorutils.CheckErrorf("Failed to add tool.poetry.source to pyproject.toml: %s", err.Error())
}
log.Info(fmt.Sprintf("Added tool.poetry.source name:%q url:%q", poetryRepoName, repoUrl))
log.Info("Running Poetry update")
cmd := io.NewCommand("poetry", "update", []string{})
err = gofrogcmd.RunCmd(cmd)
if err != nil {
return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error())
}
return err
}

0 comments on commit 1c2769b

Please sign in to comment.