MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / installDependenciesToTarget

Function installDependenciesToTarget

pkg/python/python.go:706–722  ·  view source on GitHub ↗
(ctx *gcp.Context, l *libcnb.Layer, reqs []string, installerName string, targetPlatform string, cmdBuilder func(string) []string)

Source from the content-addressed store, hash-verified

704
705func baseuvPipInstallArgs(req string) []string {
706 cmd := []string{"uv", "pip", "install"}
707 if req == "." {
708 cmd = append(cmd, ".")
709 } else {
710 cmd = append(cmd, "-r", req)
711 }
712 // --reinstall: Reinstall all packages to ensure fresh installation.
713 // --link-mode=copy: Copy files instead of hardlinking to ensure the target
714 // directory is self-contained and portable.
715 cmd = append(cmd, "--reinstall", "--link-mode=copy")
716 return appendVendoringFlags(cmd)
717}
718
719func installDependenciesToTarget(ctx *gcp.Context, l *libcnb.Layer, reqs []string, installerName string, targetPlatform string, cmdBuilder func(string) []string) error {
720 targetDir, targetPath := resolvePipTargetPaths(ctx)
721 ctx.Logf("Installing dependencies to target directory: %s using %s", targetDir, installerName)
722
723 separator := ":"
724 if strings.HasPrefix(targetPlatform, "windows") {
725 separator = ";"

Callers 2

InstallMethod · 0.85
InstallMethod · 0.85

Calls 4

resolvePipTargetPathsFunction · 0.85
LogfMethod · 0.80
ApplicationRootMethod · 0.80

Tested by

no test coverage detected