You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.python-version file is not used to establish the python version #458
Description:
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 #450
Reading from .python-version when the python-version input is unset is documented in action.yml -
description: "Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset."
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.
changed the title [-]`.python-version `file is not used to establish the python version[/-][+]`.python-version` file is not used to establish the python version[/+]on Jul 12, 2022
Hi, @gg-kialo 👋 Thanks for that issue, actually it's not a bug, but a piece of excess information in the documentation. Since v4.1.0 action will check .python-version file either if .python-version file is specified in python-version-path input or if the path that is specified in python-version-path doesn't exist. Sorry for the inconvenience, we're going to fix the documentation as soon as possible.
Would you consider restoring the old behaviour? I've only just gone through all my repos and workflows and removed the with: python-version: xxx lines.
I quite like tooling respecting my toolchain files without me having to tell them to do so (like rust+cargo, nvm, etc.).
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.
All my CI workflows are still failing since they don't explicitly specify python-version-file. I guess GitHub Actions uses the latest available release of actions/setup-python@v4 (v4.1.0 at the moment) . Is there an ETA for a new release that includes the restored behavior introduced in #465? I'm trying to assess if it's worth to update all my CI workflows or just wait for the new release.
Activity
[-]`.python-version `file is not used to establish the python version[/-][+]`.python-version` file is not used to establish the python version[/+]IvanZosimov commentedon Jul 12, 2022
Hi, @gg-kialo 👋 Thanks for that issue, actually it's not a bug, but a piece of excess information in the documentation. Since v4.1.0 action will check
.python-versionfile either if.python-versionfile is specified inpython-version-pathinput or if the path that is specified inpython-version-pathdoesn't exist. Sorry for the inconvenience, we're going to fix the documentation as soon as possible.gg-kialo commentedon Jul 13, 2022
Would you consider restoring the old behaviour? I've only just gone through all my repos and workflows and removed the
with: python-version: xxxlines.I quite like tooling respecting my toolchain files without me having to tell them to do so (like rust+cargo, nvm, etc.).
rs-garrick commentedon Jul 15, 2022
Why do we have to add the default filename to our actions in all of our repos? Shouldn't the default behaviour just find the default file?
IvanZosimov commentedon Jul 18, 2022
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.
IvanZosimov commentedon Jul 19, 2022
Hi, @ALL, I'm closing this issue now as the PR mentioned above was merged. If you have any additions feel free to ping us.
OmeGak commentedon Jul 19, 2022
All my CI workflows are still failing since they don't explicitly specify
python-version-file. I guess GitHub Actions uses the latest available release ofactions/setup-python@v4(v4.1.0 at the moment) . Is there an ETA for a new release that includes the restored behavior introduced in #465? I'm trying to assess if it's worth to update all my CI workflows or just wait for the new release.IvanZosimov commentedon Aug 2, 2022
Hi, @OmeGak 👋 Sorry for the long delay, the new version of setup-python is released.