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

setup-python does not setup the default python version as specified #425

Closed
2 of 5 tasks
shelper opened this issue Jun 10, 2022 · 2 comments
Closed
2 of 5 tasks

setup-python does not setup the default python version as specified #425

shelper opened this issue Jun 10, 2022 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@shelper
Copy link

shelper commented Jun 10, 2022

Description:
i have the following setup in my ci.yml

env:
  PYTHON_VERSION: 3.8
  POETRY_VERSION: 1.2.0a2
...
Jobs:
  ci:
     steps:
      - name: Setup Python with poetry caching
        id: setup-python
        uses: actions/setup-python@v3
        with:
          python-version: ${{env.PYTHON_VERSION}}
          cache: 'poetry'
      - name: run poetry shell
         run: poetry shell

I saw that python 3.8 is successfully setted up.

Run actions/setup-python@v3
  with:
    python-version: 3.8
    cache: poetry
    token: ***
  env:
    PYTHON_VERSION: 3.8
    POETRY_VERSION: 1.2.0a2
Successfully setup CPython (3.8.10)
"C:\Program Files (x86)\pipx_bin\poetry.exe" config --list
cache-dir = "C:\\Users\\runneradmin\\AppData\\Local\\pypoetry\\Cache"
experimental.new-installer = true
installer.parallel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "***cache-dir***\\virtualenvs"  # C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs
poetry cache is not found

but why the next step of run poetry shell still says active python version of 3.7?

Run poetry shell
poetry shell
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '**_0_**'"
env:
PYTHON_VERSION: 3.8
POETRY_VERSION: 1.2.0a2
pythonLocation: C:\hostedtoolcache\windows\Python\3.8.10\x64
**The currently activated Python version 3.7.9 is not supported by the project (^3.8.0).**
Trying to find and use a compatible version.
Using python3 (3.8.10)
Creating virtualenv zetta-lstthbR--py3.8 in C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs
Spawning shell within C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\zetta-lstthbR--py3.8
PowerShell 7.2.4
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.

Action version:
Specify the action version
tried both v3 and v4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted
@shelper shelper added bug Something isn't working needs triage labels Jun 10, 2022
@Kurt-von-Laven
Copy link
Contributor

This seems like a duplicate of #374. I am not a maintainer of the setup-python action, but I suggest taking a look at #374 (comment) for a work around until the root cause is fixed.

@shelper
Copy link
Author

shelper commented Jun 10, 2022

thanks @Kurt-von-Laven but on windows i cannot use something like poetry env use 3.8... i have to write something to find the location of python on windows and pass the full path to poetry env use path. i will close this anyway, and post acomment in #374

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

2 participants