Unhelpful error message related to unresolvable python version
See original GitHub issueDescription:
When neither python-version
or python-version-file
is set, and there is no version file matching python-version-file
’s default (.python-version
), the error message could use an improvement. Currently it is not helpful, and even somewhat confusing.
Action version: v4.0.0
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
All.
Repro steps:
https://github.com/scop/bash-completion/runs/6798283007?check_suite_focus=true#step:3:1
Expected behavior: Helpful error message. For example:
Error: Could not determine Python version to set up. Please either specify a version using
python-version
in the action configuration, or path to a valid version file usingpython-version-file
. The version file currently in effect, /home/runner/work/bash-completion/bash-completion/.python-version, does not exist.
Actual behavior: Unhelpful error message:
Error: The specified python version file at: /home/runner/work/bash-completion/bash-completion/.python-version does not exist
There are two problems with this:
- I did not specify a python version file
- It’s kind of an unexpected change coming from setup-python v3, and does not point towards a good way to fix it. The only hint is towards pointing to
.python-version
which isn’t arguably good advice, because those files in many workflows are not something that are supposed to be checked in to git in the first place, because they are expected to contain for example pyenv virtual env names which are specific to developer local setups, not something to share. In that sense, it is also a quite unfortunate default.
Issue Analytics
- State:
- Created a year ago
- Reactions:9
- Comments:22 (5 by maintainers)
Top GitHub Comments
Is there any reason why it can’t just default to the previous behavior when no
python-version
is provided and the.python-version
file does not exist?I see myself touching a lot of repositories to get this merged otherwise since i tend to just use the latest version provided by the action when i’m using it in the context of having to run some generic python tooling rather than working on an actual python project.
Would the recommended solution be to just use the system python that is provided by the runner?
Regardless of whether the semantics get brought back to v3, having a clearer error message about needing to specify one of
python-version
orpython-version-file
would help.