gradle: search for python3.11 binary for AL2023 support (#31227)
This commit is contained in:
12
build.gradle
12
build.gradle
@@ -159,6 +159,18 @@ python {
|
||||
envPath = '.venv'
|
||||
minPythonVersion = '3.10' // should be 3.10 for local development
|
||||
|
||||
// Amazon Linux support.
|
||||
// The airbyte-ci tool runs gradle tasks in AL2023-based containers.
|
||||
// In AL2023, `python3` is necessarily v3.9, and later pythons need to be installed and named explicitly.
|
||||
// See https://github.com/amazonlinux/amazon-linux-2023/issues/459 for details.
|
||||
try {
|
||||
if ("python3.11 --version".execute().waitFor() == 0) {
|
||||
// python3.11 definitely exists at this point, use it instead of 'python3'.
|
||||
pythonBinary "python3.11"
|
||||
}
|
||||
} catch (IOException _) {
|
||||
// Swallow exception if python3.11 is not installed.
|
||||
}
|
||||
// Pyenv support.
|
||||
try {
|
||||
def pyenvRoot = "pyenv root".execute()
|
||||
|
||||
Reference in New Issue
Block a user