[sdk/pthon] Version Check: Handle virtual env correctly (#8465)
* Handle virtual env correctly * Add CHANGELOG entry * Correctly display which version is EOL
This commit is contained in:
parent
7222e5570a
commit
87d8c7f074
|
@ -21,5 +21,8 @@
|
|||
- [codegen/typescript] - Respect default values in Pulumi object types.
|
||||
[#8400](https://github.com/pulumi/pulumi/pull/8400)
|
||||
|
||||
- [cli] - Catch expected errors in filestate backend stacks.
|
||||
- [sdk/python] - Correctly handle version checking python virtual environments.
|
||||
[#8465](https://github.com/pulumi/pulumi/pull/8465)
|
||||
|
||||
- [cli] - Catch expected errors in stacks with filestate backends.
|
||||
[#8455](https://github.com/pulumi/pulumi/pull/8455)
|
||||
|
|
|
@ -678,7 +678,7 @@ func validateVersion(virtualEnvPath string) {
|
|||
var versionCmd *exec.Cmd
|
||||
var err error
|
||||
versionArgs := []string{"--version"}
|
||||
if virtualEnvPath == "" {
|
||||
if virtualEnvPath != "" {
|
||||
versionCmd = python.VirtualEnvCommand(virtualEnvPath, "python", versionArgs...)
|
||||
} else if versionCmd, err = python.Command(versionArgs...); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to find python executable\n")
|
||||
|
@ -701,6 +701,6 @@ func validateVersion(virtualEnvPath string) {
|
|||
} else if parsed.LT(eolPythonVersion) {
|
||||
fmt.Fprintf(os.Stderr, "Python %d.%d is approaching EOL and will not be supported in Pulumi soon."+
|
||||
" Check %s for more details\n", parsed.Major,
|
||||
eolPythonVersion.Minor, eolPythonVersionIssue)
|
||||
parsed.Minor, eolPythonVersionIssue)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue