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

pythonLocation no longer being set in v4 #537

Closed
2 of 5 tasks
shadycuz opened this issue Nov 8, 2022 · 5 comments
Closed
2 of 5 tasks

pythonLocation no longer being set in v4 #537

shadycuz opened this issue Nov 8, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@shadycuz
Copy link

shadycuz commented Nov 8, 2022

Description:
When upgrading from setup-python@v3 to setup-python@v4, other jobs fail because env.pythonLocation is no longer being set.

Action version:
v4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
all?

Repro steps:
Here is the PR. Here is the failed build.

Expected behavior:
python location to be available.

Actual behavior:
It appears to be empty.

Here is the code that now fails with v4.

- name: Set up Python
   uses: actions/setup-python@v4

- name: Python Cache
   uses: actions/cache@v3
     with:
       path: ${{ env.pythonLocation }}
       key: ${{ env.pythonLocation }}-${{ hashFiles('tests/requirements.txt') }}
@shadycuz shadycuz added bug Something isn't working needs triage labels Nov 8, 2022
@MaksimZhukov
Copy link
Contributor

Hello @shadycuz! Thank you for reporting this!
We will investigate the issue and let you know as soon as we have updates.

@dsame
Copy link
Contributor

dsame commented Nov 18, 2022

Hello @shadycuz
The problem appears because the step Set up Python does not have python version from the hosted toolcache.

You should point out some:

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'

This build (with python-version:) shows the the pipeline fixed: https://github.com/akv-demo/setup-python-test/actions/runs/3495220045/jobs/5851739586#step:5:14

And this build (without python-version:) repros the issues: https://github.com/akv-demo/setup-python-test/actions/runs/3495204909/jobs/5851706555#step:5:16

Please confirm the answer solves the issue.

@shadycuz
Copy link
Author

shadycuz commented Nov 18, 2022

@dsame But I used to not have to manually specify python-version: '3.9' to get it to work. Was that a breaking change from v3 to v4.

Edit: your own experiment seems to show that it worked in v3 but doesn't in v4.

@dmitry-shibanov
Copy link
Contributor

Hello @shadycuz. It is an expected behaviour because in v3 tag the action had default value for python-version input. It was removed in scope of this pull request.

@shadycuz
Copy link
Author

Alright alright, I read throught the 4.0 release notes again and it does seem to call out that the default is going away. I think it could be clearer. Same with the error msg. If a user did not specify python-version and you don't find a python file. Then perhaps you could tell them they need one or the other.

I don't really like this change, but I guess its time I use the python version file.

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

4 participants