Fix Python version detection in GitHub Actions workflows#2
Merged
Conversation
Co-authored-by: MauGx3 <225707+MauGx3@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix test discovery for correct Python version
Fix Python version detection in GitHub Actions workflows
Oct 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The tests were failing because Python versions were not being discovered properly in GitHub Actions workflows. The workflows were attempting to use Python 3.1 instead of Python 3.10, causing setup failures.
Root Cause
YAML treats unquoted decimal numbers as floats, which causes trailing zeros to be dropped. When the workflow files specified
python-version: [3.10, 3.11], YAML parsed these as:3.10→3.1(float, losing the trailing zero)3.11→3.11(float, no trailing zero to lose)This resulted in GitHub Actions attempting to install Python 3.1, which doesn't exist in modern Python versions.
Solution
Quote the Python version numbers to ensure they are treated as strings rather than floats:
Before:
After:
Changes
.github/workflows/pytest.ymlto quote Python versions:["3.10", "3.11"].github/workflows/pyright.ymlto quote Python version:["3.10"]Verification
Tested with Python's YAML parser to confirm the fix:
This is a common YAML gotcha when working with version numbers that have trailing zeros. The fix ensures GitHub Actions will correctly discover and use Python 3.10 and 3.11.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.