-
Notifications
You must be signed in to change notification settings - Fork 612
Unhelpful error message related to unresolvable python version #421
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
Comments
Hello @scop. Thank you for your report. We will investigate the issue. I think we should update the error message to be more informative and add notes about the new behaviour to the documentation. |
Is there any reason why it can't just default to the previous behavior when no 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? |
That's what I'd prefer, too. |
I dont see a clear reason in the changelog. I agree with the proposed behaviour. This quite big breaking change is unnecessary/avoidable. The latest stable python was always the default, the user has the ability to choose if they want a specific version. Plus a reason to not go forward with this, is the fact that dependabot doesn't update to the latest version of python defined in the workflow, only the action, meaning pinning vulnerable tags is going to be more common. |
I've got lots of repositories with things like: steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0 # or some other one line run here (and tutorials, etc). All of them will have to have a manual version added, that now needs to be updated yearly. It does seem like a default to fall back on "latest" if the version file isn't present like v1-v3 would be really nice if possible! These repo's don't have a single Python "version" that should be locked by a file, it's just needed to do a bit of Python for style, updates, etc. The regular CI jobs have the normal matrix of versions. Adding the |
The argument for the change made in https://github.com/actions/setup-python/pull/336/files#r854878982 is that it brings it inline with what the other Whilst i'm not all to happy about this, i can see the merits of it, so i guess dependabot is going to provide me with ample work over the course of the next few days or weeks (no biggie tho). The closest I've found to specifying latest so far is using - uses: actions/setup-python@v4
with:
python-version: '3.x' Looking back at 2to3, this does seem to make sense (although i hope there will never be a reason for 3to4 given tooling like |
Perhaps somewhat cosmetic as far as the real world effects go, but note that per the usage docs, this supports "SemVer's version range syntax", which I guess means https://docs.npmjs.com/cli/v6/using-npm/semver#ranges. In that sense, one might want to use something like |
So it doesn't behave like |
Regardless of whether the semantics get brought back to v3, having a clearer error message about needing to specify one of |
IMO, it would have been better to update Also, it should be pointed out that I realized that setting |
The official way to specify Python version is using |
It also also would help having updated the |
Just a warning, this is all-or-nothing. If you specify any If you are not developing a package (like a website, analysis, etc), then it's a bit weird to specify just this, but you aren't building, so it's probably not harmful. A non-package project is more likely to be happy with Footnotes
|
checkout@v2 -> v3 upload/download-artifact@v2 -> v3 python-setup@v2 -> v3 pypa/gh-action-pypi-publish@1.4.2 -> v1.5.0 Python latest is v4, but it breaks working with default Python version actions/setup-python#421
Hi, everyone 👋 ! This PR was created to fix problems with |
Hi, everyone 👋 PR with fixes was merged, and by now I'm going to close this issue. If you have any questions or additions, feel free to ping us! |
@IvanZosimov so the explicit version is still a hard requirement, right? |
Apparently, yes 🙃. |
Hi, @abitrolly and @ljmf00 👋 ! It's not a hard requirement, If you don't specify the |
I suggest linking to the syntax available for ranges from README.md. Simply referring to them as "SemVer ranges" leaves some ambiguity, Python oriented audience is quite likely not aware that this means the particular npm package's range support -- the general concept of ranges does not exist in semantic versioning proper (as in https://semver.org). |
@IvanZosimov nice to know. Is it possible to add a changelog to this action to reference to changes made between action versions? |
Thank you for your suggestions, @scop and @abitrolly ❤️ They really make sense, so we will try to make documentation and change logs clearer. |
We can look at the bright side, that change was introduced in v4, so it did follow the semver --- it was indeed a breaking change. I don't think that this bug should be closed because there is no reason for dropping the ability to "just install a python version", without mentioning which one you want. In ~90% of cases I do mention specific python versions but I do also have ~10% of cases, where, on-purpose, I do not mention the python version. Those jobs are those testing the system compatibility. With v4, that is no longer possible, I bet I am not the only one facing this problem. |
…ecomment-1174810835 we need to specify the python version
Description:
When neither
python-version
orpython-version-file
is set, and there is no version file matchingpython-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:
Runner type:
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:
Actual behavior:
Unhelpful error message:
There are two problems with this:
.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.The text was updated successfully, but these errors were encountered: