From c0cd244e224ea95de7e43eb65772885b6c4774d2 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 3 Mar 2025 16:44:05 +0100 Subject: [PATCH] refactor: Add context import and TODOs for test improvements --- libs/patchwheel/patchwheel_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/patchwheel/patchwheel_test.go b/libs/patchwheel/patchwheel_test.go index 7d284cd16..b7a32ba82 100644 --- a/libs/patchwheel/patchwheel_test.go +++ b/libs/patchwheel/patchwheel_test.go @@ -2,6 +2,7 @@ package patchwheel import ( "bytes" + "context" "io/ioutil" "os" "os/exec" @@ -12,6 +13,7 @@ import ( // minimalPythonProject returns a map of file paths to their contents for a minimal Python project. func minimalPythonProject() map[string]string { + // AI TODO: switch to pyproject.toml here return map[string]string{ // A simple setup.py that uses setuptools. "setup.py": `from setuptools import setup, find_packages @@ -58,6 +60,7 @@ func TestPatchWheel(t *testing.T) { for _, py := range pythonVersions { t.Run(py, func(t *testing.T) { // Create a temporary directory for the project. + // AI TODO: use t.TempDir() instead tempDir, err := ioutil.TempDir("", "myproj") if err != nil { t.Fatal(err) @@ -72,6 +75,7 @@ func TestPatchWheel(t *testing.T) { // Create a virtual environment. venvDir := filepath.Join(tempDir, "venv") + // AI TODO: use "uv init --python " to create venv if out, err := runCmd(tempDir, py, "-m", "venv", "venv"); err != nil { t.Fatalf("venv creation failed: %v, output: %s", err, out) } @@ -107,8 +111,10 @@ func TestPatchWheel(t *testing.T) { if err != nil { t.Fatalf("PatchWheel failed: %v", err) } + t.Logf("origWheel=%s patchedWheel=%s", origWheel, patchedWheel) // Install the patched wheel. + // AI TODO: use uv if out, err := runCmd(tempDir, pipExec, "install", "--force-reinstall", patchedWheel); err != nil { t.Fatalf("failed to install patched wheel: %v, output: %s", err, out) }