fix: update Python version to 3.11 and use latest setup-python action in workflows#317
fix: update Python version to 3.11 and use latest setup-python action in workflows#317ttak-apphelix wants to merge 11 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates CI workflows to run tests under Python 3.10 and modernizes the setup-python GitHub Action used to provision Python in those workflows.
Changes:
- Bump workflow matrix Python version from 3.9 to 3.10.
- Upgrade
actions/setup-pythonfromv1tov5in affected workflows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/syntax-test.yml | Moves Syntax Test workflow to Python 3.10 and updates setup-python action. |
| .github/workflows/playbook-test.yml | Moves Playbook Test workflow to Python 3.10 and updates setup-python action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| max-parallel: 4 | ||
| matrix: | ||
| python-version: [3.9] | ||
| python-version: ['3.11'] |
There was a problem hiding this comment.
Should this be 3.12? (To match requirements file.)
There was a problem hiding this comment.
Yes, plan is to update this to 3.12. But current challenge is Ansible 9+ removed support for deprecated include syntax used in playbooks and lower version(ansible<9.0.0) is not supported on 3.12.
Plan is to create a separate PR which will require a SRE support where they can validate all the changes and update this to 3.12 with updated Ansible version.
There was a problem hiding this comment.
Makes sense, thanks! (Might be good to include this in the PR description, and the commit message when you squash.)
There was a problem hiding this comment.
- As discussed in meeting, renaming the file to
requirements3_11.txt(assuming we even need multiple requirements files), would help avoid some confusion. - We should update comments appropriately about the relationship between python and ansible versions, and deferring the ansible upgrade. We may want a new ticket to link to, but I think https://2u-internal.atlassian.net/browse/GSRE-2249?focusedCommentId=5530695 might be the closest one to this topic at this time, except it is focused on the ubuntu upgrade.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Fixes GitHub Actions workflow failures caused by Python 3.9 being removed from hosted runners (EOL October 2025).
Changes
Workflows
3.9to'3.11'(quoted to prevent YAML float parsing)actions/setup-pythonfrom v1 to v52. Consolidated Requirements Structure (Reverting PR #175)
This PR reverts the approach taken in PR #175, which introduced separate
base3_12.infiles. Instead, we:requirements/base.into use Python 3.11+ compatible dependenciesrequirements/base3_12.inrequirements3_12.txtrequirements.txtMakefileto remove Python version-specific compilation stepsDependencies
requirements/base.inand generatedrequirements.txtwith Ansible 8.7.0includesyntax used in playbooksansible<9.0.0constraint torequirements/constraints.txtto prevent future upgradesFuture Migration to Python 3.12
Yes, the plan is to update to Python 3.12 in the future. However, the current challenge is that Ansible 9+ (which supports Python 3.12) removed support for the deprecated
includesyntax used throughout the playbooks, and Ansible versions < 9.0.0 are not supported on Python 3.12.The plan is to create a separate PR that will require SRE support to validate all the changes and update to Python 3.12 with an updated Ansible version. This will involve:
- include:syntax toinclude_tasks:orimport_tasks:ansible<9.0.0constraint fromrequirements/constraints.txtJIRA ticket
https://2u-internal.atlassian.net/browse/BOMS-408