Skip to content

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Oct 26, 2025

Description

Enhances the setup_python action to support specifying Python versions via a file (e.g., .python-version, pyproject.toml, .tool-versions, Pipfile) in addition to direct input. Adds a shared determine_version.sh script for parsing version files, updates action.yml and post-ci.sh to use this logic, and expands tests to cover multiple file formats and scenarios. Documentation and CI matrix are updated to reflect new capabilities. Also adds python-version and python-path outputs.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0c0ec2c) to head (ab86274).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #71   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          820       820           
  Branches        82        82           
=========================================
  Hits           820       820           
Flag Coverage Δ
Linux 100.00% <ø> (ø)
Windows 83.04% <ø> (ø)
macOS 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@ReenigneArcher ReenigneArcher force-pushed the feat/setup_python/multi-version branch 12 times, most recently from 2f0b14a to 2b3f2cd Compare October 27, 2025 01:33
…e input

Enhances the setup_python action to support specifying Python versions via a file (e.g., .python-version, pyproject.toml, .tool-versions, Pipfile) in addition to direct input. Adds a shared determine_version.sh script for parsing version files, updates action.yml and post-ci.sh to use this logic, and expands tests to cover multiple file formats and scenarios. Documentation and CI matrix are updated to reflect new capabilities.
Consolidates repetitive test logic into a helper function and uses pytest parametrization to test multiple file types for Python version extraction. This improves maintainability and coverage while reducing code duplication.
Simplifies the export of PYTHON_VERSIONS and DEFAULT_PYTHON_VERSION by removing unnecessary echo statements and exporting both variables in a single command.
Added a table describing the outputs 'python-version' and 'python-path' to the README, clarifying what information the action provides.
Improved test assertions and error handling in setup_python and version determination tests. Replaced conditional skips with assert statements for return codes, streamlined output parsing, and added missing imports. Updated multiple-versions .python-version file to include explicit version entries.
Introduced to_bash_path to convert Windows paths to Unix-style for bash compatibility. Updated determine_version.sh invocations to use forward slashes, ensuring tests work correctly on Windows environments using Git Bash.
Ensures the python path is converted to Windows format using cygpath when running on Windows runners, improving compatibility for downstream steps.
Updated test_setup_python.py to skip tests if PYTHON_VERSIONS is not set instead of asserting. Refactored subprocess.Popen calls in test_version_determination.py to use the 'args' keyword for clarity and consistency.
@ReenigneArcher ReenigneArcher force-pushed the feat/setup_python/multi-version branch from 56589af to ab86274 Compare October 28, 2025 00:22
@sonarqubecloud
Copy link

@ReenigneArcher ReenigneArcher merged commit 5cef39b into master Oct 28, 2025
70 checks passed
@ReenigneArcher ReenigneArcher deleted the feat/setup_python/multi-version branch October 28, 2025 00:50
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.

2 participants