Skip to content

Commit

Permalink
pass --python to "uv pip install"
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 18, 2024
1 parent b6e7d1a commit a9c2e5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration/bundle/init_default_python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ func testDefaultPython(t *testing.T, pythonVersion string) {
testcli.PrepareReplacementsUser(t, replacements, *user)
}

tmpDir1 := pythontest.RequirePythonVENV(t, ctx, pythonVersion, true)
tmpDir1, pythonExe := pythontest.RequirePythonVENV(t, ctx, pythonVersion, true)
extras, ok := extraInstalls[pythonVersion]
if ok {
args := append([]string{"pip", "install"}, extras...)
args := append([]string{"pip", "install", "--python", pythonExe}, extras...)
testutil.RunCommand(t, "uv", args...)
}

Expand Down
4 changes: 2 additions & 2 deletions libs/python/pythontest/pythontest.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
)

func RequirePythonVENV(t testutil.TestingT, ctx context.Context, pythonVersion string, checkVersion bool) string {
func RequirePythonVENV(t testutil.TestingT, ctx context.Context, pythonVersion string, checkVersion bool) (string, string) {
tmpDir := t.TempDir()
testutil.Chdir(t, tmpDir)

Expand All @@ -28,5 +28,5 @@ func RequirePythonVENV(t testutil.TestingT, ctx context.Context, pythonVersion s
require.True(t, strings.HasPrefix(actualVersion, expectVersion), "Running %s --version: Expected %v, got %v", pythonExe, expectVersion, actualVersion)
}

return tmpDir
return tmpDir, pythonExe
}

0 comments on commit a9c2e5c

Please sign in to comment.