Skip to content

action always prefers the default '.python-version' supplied version if it exists #1086

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

Closed
5 tasks done
rjdbcm opened this issue Apr 17, 2025 · 1 comment
Closed
5 tasks done
Labels
bug Something isn't working needs triage

Comments

@rjdbcm
Copy link

rjdbcm commented Apr 17, 2025

Description:

According to the README

The python-version input is optional. If not supplied, the action will try to resolve the version from the default .python-version file. If the .python-version file doesn't exist Python or PyPy version from the PATH will be used.

however, if a repo has a .python-version file, the version in that file will always be used instead of that supplied in the action argument python-version.

Action version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
applies to all valid versions

Repro steps:

In an actions workflow:

  1. checkout a repo with a valid .python-version file
  2. run setup-python with a valid python-version argument

Expected behavior:
I expected setup-python to prefer the python-version argument when it is available.

Actual behavior:
setup-python uses the version contained in .python-version instead of the one supplied in the argument.

@rjdbcm rjdbcm added bug Something isn't working needs triage labels Apr 17, 2025
@rjdbcm
Copy link
Author

rjdbcm commented Apr 17, 2025

I have no idea what happened, I thought it was setup-python but I cant reproduce it now.

@rjdbcm rjdbcm closed this as completed Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant