Skip to content

Windows runners not using correct Python #92

@davidorme

Description

@davidorme

We've got a CI setup configured to install the latest poetry and have some odd behaviour on Windows runners. The CI script works fine on Mac and Ubuntu, but on Windows, poetry installs using a different version of python. We have it running using Python 3.11, 3.12 and 3.13 but in all three cases, poetry reports "installed package poetry 2.1.3, installed using Python 3.9.13".

The relevant sections of the CI workflow are shown below (copied from https://github.com/ImperialCollegeLondon/virtual_ecosystem/actions/runs/16728349047/job/47349994898)

The workflow file being used is here:
https://github.com/ImperialCollegeLondon/virtual_ecosystem/blob/7149746e376334805668af4b997bab91bf3bafb1/.github/workflows/ci.yml

Run actions/setup-python@v5
  with:
    python-version: 3.11
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
    freethreaded: false
Installed versions
  Successfully set up CPython (3.11.9)

Run abatilo/actions-poetry@v4.0.0
  with:
    poetry-version: latest
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.11.9\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.11.9\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
Run pipx install poetry
  pipx install poetry
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: C:\hostedtoolcache\windows\Python\3.11.9\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.11.9\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.11.9\x64
Found a space in the pipx home path. We heavily discourage this, due to
    multiple incompatibilities. Please check our docs for more information on
    this, as well as some pointers on how to migrate to a different home path.
creating virtual environment...
installing poetry...
done! 
  installed package poetry 2.1.3, installed using Python 3.9.13
  These apps are now globally available
    - poetry.exe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions