-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(setup_python): Add support for multiple versions and version file input #71
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. |
2f0b14a to
2b3f2cd
Compare
…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.
56589af to
ab86274
Compare
|



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-versionandpython-pathoutputs.Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage