1
0
mirror of synced 2025-12-19 18:14:56 -05:00

gradle: search for python3.11 binary for AL2023 support (#31227)

This commit is contained in:
Marius Posta
2023-10-10 13:15:02 -07:00
committed by GitHub
parent 898846d40a
commit ae2ca40113
6 changed files with 28 additions and 3 deletions

View File

@@ -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()