Skip to content

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

Closed
@shelper

Description

@shelper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions