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

Function Version

pkg/python/python.go:106–112  ·  view source on GitHub ↗

Version returns the installed version of Python.

(ctx *gcp.Context)

Source from the content-addressed store, hash-verified

104
105// Version returns the installed version of Python.
106func Version(ctx *gcp.Context) (string, error) {
107 result, err := ctx.Exec([]string{"python3", "--version"})
108 if err != nil {
109 return "", err
110 }
111 return strings.TrimSpace(result.Stdout), nil
112}
113
114// RuntimeVersion validate and returns the customer requested Python version by inspecting the
115// environment variables and .python-version file.

Callers 6

pythonSystemDirFunction · 0.92
prepareDependenciesLayerFunction · 0.70
ensureUVVenvFunction · 0.70
PipInstallPyprojectFunction · 0.70

Calls 1

ExecMethod · 0.80

Tested by

no test coverage detected