setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

windows-latest-8-core: hostedtoolcache Python 3.9.13 no longer includes setuptools.

Open ablatner opened this issue 2 years ago • 6 comments

Description

Last ran successfully at Oct 20 3:10AM PST with windows-latest-8-core_4cf9d486f7a5 First failed at 10:04AM PST with windows-latest-8-core_81fb0be27f50 Both with runner version 2.309.0

This workflow began failing this morning with no updates on our end.

Run py ./<redacted>/get_version_string.py
py ./<redacted>/get_version_string.py
shell: C:\Windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
env:
  pythonLocation: C:\hostedtoolcache\windows\Python\3.9.13\x64
  PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.9.13\x64/lib/pkgconfig
  Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.9.13\x64
  Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.9.13\x64
  Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.9.13\x64
Traceback (most recent call last):
  File "C:\a\<redacted>/get_version_string.py", line 46, in <module>
    from setuptools.extern import packaging  # pylint: disable=no-name-in-module
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'setuptools'

Platforms affected

  • [ ] Azure DevOps
  • [ ] GitHub Actions - Standard Runners
  • [X] GitHub Actions - Larger Runners

Runner images affected

  • [ ] Ubuntu 20.04
  • [ ] Ubuntu 22.04
  • [ ] macOS 11
  • [ ] macOS 12
  • [ ] macOS 13
  • [ ] Windows Server 2019
  • [X] Windows Server 2022

Image version and build link

windows-latest-8-core_81fb0be27f50

Is it regression?

windows-latest-8-core_4cf9d486f7a5

Expected behavior

setuptools included by default

Actual behavior

setuptools import failed

Repro steps

  • setup-python 3.9.13
  • Run Python script with from setuptools.extern import packaging

ablatner avatar Oct 20 '23 19:10 ablatner

@dmitry-shibanov could you take a look?

mikhailkoliada avatar Oct 20 '23 19:10 mikhailkoliada

I'm able to work around this with the expected pip command:

    - name: Install setuptools
      shell: cmd
      run: py -m pip install --upgrade pip setuptools wheel

ablatner avatar Oct 20 '23 22:10 ablatner

Hello @ablatner. I've tried to reproduce the issue but it works as expected. Could you please provide a public repository to reproduce the issue?

dmitry-shibanov avatar Oct 23 '23 10:10 dmitry-shibanov

This seems to reproduce it: https://github.com/ablatner/windows-runner-test/pull/1

It calls setup-python with 3.9.13 and then runs a script that imports setuptools.extern.

Note that this uses windows-latest instead of windows-latest-8-core because it's not inside my organization.

ablatner avatar Oct 23 '23 17:10 ablatner

As in my org's private repo, this works after manually installing setuptools with pip: https://github.com/ablatner/windows-runner-test/pull/2

ablatner avatar Oct 23 '23 22:10 ablatner

@dmitry-shibanov this is still an issue, demonstrated by my test PR.

ablatner avatar Mar 05 '24 01:03 ablatner