From 174db9432c5a008c76e38ba18df6e3ec4f7f7b48 Mon Sep 17 00:00:00 2001 From: "Denis Bilenko (aider)" Date: Mon, 3 Mar 2025 16:17:29 +0100 Subject: [PATCH] feat: add context parameter to PatchWheel function --- libs/patchwheel/patchwheel.go | 4 ++-- libs/patchwheel/patchwheel_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/patchwheel/patchwheel.go b/libs/patchwheel/patchwheel.go index 390cdbf72..c4bdaa2f1 100644 --- a/libs/patchwheel/patchwheel.go +++ b/libs/patchwheel/patchwheel.go @@ -132,7 +132,7 @@ func readFile(file *zip.File) ([]byte, error) { // PatchWheel patches a Python wheel file by updating its version in METADATA and RECORD. // It returns the path to the new wheel. -func PatchWheel(path, outputDir string) (string, error) { +func PatchWheel(ctx context.Context, path, outputDir string) (string, error) { r, err := zip.OpenReader(path) if err != nil { return "", err @@ -155,7 +155,7 @@ func PatchWheel(path, outputDir string) (string, error) { } baseVersion, distribution, err := parseMetadata(metadataContent) - log.Infof(ctx, "path=%s baseVersion=%s distribution=%s err=%s", path, baseVersion, distribution) + log.Infof(ctx, "path=%s baseVersion=%s distribution=%s", path, baseVersion, distribution) if err != nil { return "", err } diff --git a/libs/patchwheel/patchwheel_test.go b/libs/patchwheel/patchwheel_test.go index 36da0ff44..7d284cd16 100644 --- a/libs/patchwheel/patchwheel_test.go +++ b/libs/patchwheel/patchwheel_test.go @@ -103,7 +103,7 @@ func TestPatchWheel(t *testing.T) { if err := os.Mkdir(outputDir, 0o755); err != nil { t.Fatal(err) } - patchedWheel, err := PatchWheel(origWheel, outputDir) + patchedWheel, err := PatchWheel(context.Background(), origWheel, outputDir) if err != nil { t.Fatalf("PatchWheel failed: %v", err) }