Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace poetry update with poetry lock --no-update #1235

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions utils/python/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package utils

import (
"fmt"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"net/url"
"os"
"path/filepath"
"strings"

"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"

"github.com/jfrog/build-info-go/utils/pythonutils"
"github.com/jfrog/gofrog/io"
gofrogcmd "github.com/jfrog/gofrog/io"
Expand Down Expand Up @@ -89,15 +90,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 regeneratePoetryLock()
}

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