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

Shell Python not updating. #22

Closed
JavidPack opened this issue Sep 13, 2019 · 7 comments
Closed

Shell Python not updating. #22

JavidPack opened this issue Sep 13, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@JavidPack
Copy link

JavidPack commented Sep 13, 2019

I'm not sure if this is outside the intended scope of this action, but the updated Python version does not replace the Python used by the shell: python option in a step. This makes it so in-line scripts in my steps run on 2.7 instead of the intended 3.x.

Here are some steps I did to confirm the discrepancy:

    - run: python -c "import sys; print sys.version"
    - uses: actions/setup-python@v1
      with:
        python-version: '3.x'
        architecture: 'x64'
    - run: python -c "import sys; print(sys.version)"  
    - shell: python
      run: |    
        import sys
        print(sys.version)

The logs from running these 4 steps show the python 2.7.15 running the first step as expected, and 3.7.4 running the 3rd step as expected (since step 2 installs it), but surprisingly 2.7.15 is once again running the 4th step.

If this is intended behavior, that's fine, it just might be worth mentioning somewhere in the readme.md since this feels like an inconsistency to me.

@konradpabjan konradpabjan self-assigned this Nov 13, 2019
@konradpabjan konradpabjan added the bug Something isn't working label Nov 13, 2019
@konradpabjan
Copy link
Collaborator

Looks to be an issue inside our runner, if -shell: python is used, for some reason it's using the default system python instead of what is in PATH which is what this action is modifying.

This is going to require some changes on our back-end so no rough ETA. We have an internal issue tracking this. When this does get fixed I'll make sure to update our docs for some clarity around the python shell

@michaelbeaumont
Copy link

The following seems to be a workaround:

        shell: bash -c "$RUNNER_TOOL_CACHE/Python/3.8.0/x64/python {0}"

Replace Python, 3.8.0 or x64 with whatever you need

@cclauss
Copy link
Contributor

cclauss commented Jan 8, 2020

Given https://pythonclock.org it would be nice to see a real fix to this issue.

@miyajan
Copy link

miyajan commented Jan 27, 2020

FYI, this issue seems to be fixed now.

@konradpabjan
Copy link
Collaborator

Yup, confirming this issue has been fixed

@YVS37
Copy link

YVS37 commented Dec 15, 2021

U

@ThatXliner
Copy link

Wait does it use the Python from setup-python?

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

7 participants