Skip to content

Commit 06229af

Browse files
committed
refactor(uv): port to common BuildPlanMetadata
1 parent 45a6022 commit 06229af

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

pkg/installers/uv/detect.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ import (
1111

1212
"github.com/paketo-buildpacks/packit/v2"
1313
"github.com/paketo-buildpacks/packit/v2/fs"
14-
)
1514

16-
type BuildPlanMetadata struct {
17-
VersionSource string `toml:"version-source"`
18-
Build bool `toml:"build"`
19-
Version string `toml:"version"`
20-
}
15+
pythoninstallers "github.com/paketo-buildpacks/python-installers/pkg/installers/common"
16+
)
2117

2218
// Detect will return a packit.DetectFunc that will be invoked during the
2319
// detect phase of the buildpack lifecycle.
@@ -53,7 +49,7 @@ func Detect() packit.DetectFunc {
5349
plan.Requires = []packit.BuildPlanRequirement{
5450
{
5551
Name: Uv,
56-
Metadata: BuildPlanMetadata{
52+
Metadata: pythoninstallers.BuildPlanMetadata{
5753
VersionSource: "BP_UV_VERSION",
5854
Version: version,
5955
},

pkg/installers/uv/detect_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/paketo-buildpacks/packit/v2"
1414
"github.com/sclevine/spec"
1515

16+
pythoninstallers "github.com/paketo-buildpacks/python-installers/pkg/installers/common"
1617
"github.com/paketo-buildpacks/python-installers/pkg/installers/uv"
1718

1819
. "github.com/onsi/gomega"
@@ -75,7 +76,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
7576
Requires: []packit.BuildPlanRequirement{
7677
{
7778
Name: uv.Uv,
78-
Metadata: uv.BuildPlanMetadata{
79+
Metadata: pythoninstallers.BuildPlanMetadata{
7980
VersionSource: "BP_UV_VERSION",
8081
Version: "some-version",
8182
},

0 commit comments

Comments
 (0)