`.python-version` file is not used to establish the python version
See original GitHub issueDescription:
v4.1.0 introduced a regression where the repo-root .python-version
file is no longer used by default to select the python version to install.
The regression was introduced by https://github.com/actions/setup-python/pull/450/
Reading from .python-version
when the python-version
input is unset is documented in action.yml
- https://github.com/actions/setup-python/blob/00a5248c77bed9280afb34f891aa24a152490ab5/action.yml#L6-L7
Action version: v4.1.0 (regression from v4.0.0)
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version: N/A
Repro steps:
Create a repository with a .python-version
file containing 3.10.4
and a workflow containing a setup-python step, e.g.:
name: CI
on: [push]
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install python
uses: actions/setup-python@v4.0.0
Expected behavior:
setup-python should install 3.10.4 as it is listed in the .python-version
file, i.e. the step logs:
Run actions/setup-python@v4
with:
token: ***
Resolved as 3.10.4
This is the behaviour with v4.0.0.
Actual behavior:
setup-python ignores the .python-version
file and logs:
Run actions/setup-python@v4
Warning: Neither 'python-version' nor 'python-version-file' inputs were supplied.
Warning: The `python-version` input is not set. The version of Python currently in `PATH` will be used.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top GitHub Comments
Hi, @gg-kialo and @rs-garrick 👋 Thank you for your questions, we took them into consideration and decided to update behavior of the action, take a look at this PR.
Hi, @OmeGak 👋 Sorry for the long delay, the new version of setup-python is released.