Skip to content

Comments

fix: update Python version to 3.11 and use latest setup-python action in workflows#317

Open
ttak-apphelix wants to merge 11 commits intomasterfrom
ttak/BOMS-408
Open

fix: update Python version to 3.11 and use latest setup-python action in workflows#317
ttak-apphelix wants to merge 11 commits intomasterfrom
ttak/BOMS-408

Conversation

@ttak-apphelix
Copy link
Member

@ttak-apphelix ttak-apphelix commented Feb 17, 2026

Description

Fixes GitHub Actions workflow failures caused by Python 3.9 being removed from hosted runners (EOL October 2025).

Changes

Workflows

  • Updated Python version from 3.9 to '3.11' (quoted to prevent YAML float parsing)
  • Upgraded actions/setup-python from v1 to v5

2. Consolidated Requirements Structure (Reverting PR #175)

This PR reverts the approach taken in PR #175, which introduced separate base3_12.in files. Instead, we:

  • Updated the main requirements/base.in to use Python 3.11+ compatible dependencies
  • Removed requirements/base3_12.in
  • Removed requirements3_12.txt
  • Updated workflows to use the consolidated requirements.txt
  • Updated Makefile to remove Python version-specific compilation steps

Dependencies

  • Updated requirements/base.in and generated requirements.txt with Ansible 8.7.0
    • Ansible 9+ removed support for deprecated include syntax used in playbooks
    • Ansible 8.7.0 (ansible-core 2.15.13) supports both Python 3.11 and existing playbook syntax
  • Added ansible<9.0.0 constraint to requirements/constraints.txt to prevent future upgrades
  • Uses Jinja2 3.1.2 (from requirements.txt) instead of deprecated 2.8 version

Future 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 include syntax 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:

  • Migrating all 63 instances of deprecated - include: syntax to include_tasks: or import_tasks:
  • Updating to Ansible 9+ which supports Python 3.12
  • Removing the ansible<9.0.0 constraint from requirements/constraints.txt

JIRA ticket

https://2u-internal.atlassian.net/browse/BOMS-408

Copilot AI review requested due to automatic review settings February 17, 2026 06:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-python from v1 to v5 in 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.

Copilot AI review requested due to automatic review settings February 17, 2026 06:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 17, 2026 09:28
@ttak-apphelix ttak-apphelix changed the title fix: update Python version to 3.10 and use latest setup-python action in workflows fix: update Python version to 3.11 and use latest setup-python action in workflows Feb 17, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 3.12? (To match requirements file.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks! (Might be good to include this in the PR description, and the commit message when you squash.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. As discussed in meeting, renaming the file to requirements3_11.txt (assuming we even need multiple requirements files), would help avoid some confusion.
  2. 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.

Copilot AI review requested due to automatic review settings February 19, 2026 13:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 20, 2026 07:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants