Version returns the installed version of Python.
(ctx *gcp.Context)
| 104 | |
| 105 | // Version returns the installed version of Python. |
| 106 | func 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. |
no test coverage detected