From f31928af4086d4dc3addb9a81d96397134949dec Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 4 Mar 2025 15:45:59 +0100 Subject: [PATCH] fix Windows --- libs/patchwheel/patch_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/patchwheel/patch_test.go b/libs/patchwheel/patch_test.go index da1febabe..d46bec66d 100644 --- a/libs/patchwheel/patch_test.go +++ b/libs/patchwheel/patch_test.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "testing" "time" @@ -14,13 +15,22 @@ import ( "github.com/stretchr/testify/require" ) +var scriptsDir = getPythonScriptsDir() + +func getPythonScriptsDir() string { + if runtime.GOOS == "windows" { + return "Scripts" + } + return "bin" +} + func verifyVersion(t *testing.T, tempDir, wheelPath string) { // Extract the expected version from the wheel filename wheelInfo, err := ParseWheelFilename(wheelPath) require.NoError(t, err) expectedVersion := wheelInfo.Version - pyExec := filepath.Join(tempDir, ".venv", "bin", "python") // Handle Windows paths appropriately + pyExec := filepath.Join(tempDir, ".venv", scriptsDir, "python") cmdOut := captureOutput(t, tempDir, pyExec, "-c", "import myproj; myproj.print_version()") actualVersion := strings.TrimSpace(cmdOut) t.Logf("Verified installed version: %s", actualVersion)