-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gradle: search for python3.11 binary for AL2023 support #31227
Changes from all commits
e8348bb
0f770ff
39030f0
dbafe67
529ceef
c6365c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓why cant we bind There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} catch (IOException _) { | ||
// Swallow exception if python3.11 is not installed. | ||
} | ||
// Pyenv support. | ||
try { | ||
def pyenvRoot = "pyenv root".execute() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,18 @@ class AirbytePythonPlugin implements Plugin<Project> { | |
envPath = venvDirectoryName | ||
minPythonVersion '3.10' | ||
|
||
// Amazon Linux support. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📚 could use some elaboration on why we do this instead of just run python. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair! |
||
// 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() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗some tools (ci_credentials, pipelines) cant currently support python3.11, this wont be an issue here but is an edge case. is python 3.10 available instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason that I don't understand, no. If it comes to that, it'll probably be simpler to change the base container to something other than amazoncorretto. I only picked it because openjdk was no longer maintained and amazoncorretto has LTS.