Skip to content
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

python-version is ignored on MacOS runners #929

Closed
2 of 5 tasks
christophfink opened this issue Aug 22, 2024 · 3 comments
Closed
2 of 5 tasks

python-version is ignored on MacOS runners #929

christophfink opened this issue Aug 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@christophfink
Copy link

christophfink commented Aug 22, 2024

Description:
Specifying a with: python-version works for Windows and Linux runners, but seemingly is ignored on MacOS runners, where setup-python resorts to the newest Python version available

Action version:
actions/setup-python@5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
n/a

Repro steps:
Run a GitHub workflow YAML file that specifies a python-version on MacOS runners. See below for an example YAML, and the following repo for a running example: https://github.com/christophfink/gh-actions-python-versions/actions/runs/10508872098

Expected behavior:
actions/setup-python installs the requested python version (as on Windows and Linux runners)

Actual behavior:
actions/setup-python installs the latest edit: default python version

Screenshot 2024-08-22 at 15 10 49

@christophfink christophfink added bug Something isn't working needs triage labels Aug 22, 2024
@priya-kinthali
Copy link
Contributor

Hello @christophfink 👋,
Thank you for reporting this. We will investigate the issue and get back to you as soon as we have updates.

@priya-kinthali priya-kinthali self-assigned this Aug 28, 2024
@priya-kinthali
Copy link
Contributor

priya-kinthali commented Sep 2, 2024

Hello @christophfink 👋,

Thank you for raising this issue. It seems that the problem with the python-version being ignored on MacOS runners may be related to the shell configuration specified in your workflow which is shell: bash -l {0}.
To avoid this, it is recommended to use the shell configuration like : shell: bash.
For more details, please refer to the related discussion here: actions/setup-python#179 (comment).
I hope this helps!

@christophfink
Copy link
Author

Hi @priya-kinthali !

Thanks for your quick help, this is, indeed, fixing the issue for me. The linked issue has a great explanation, thanks for that, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants