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

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

Closed
2 of 10 tasks
ablatner opened this issue Oct 20, 2023 · 8 comments
Closed
2 of 10 tasks
Assignees

Comments

@ablatner
Copy link

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
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • 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
@mikhailkoliada mikhailkoliada transferred this issue from actions/runner-images Oct 20, 2023
@mikhailkoliada
Copy link

@dmitry-shibanov could you take a look?

@ablatner
Copy link
Author

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

@dmitry-shibanov
Copy link
Contributor

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?

@ablatner
Copy link
Author

ablatner commented Oct 23, 2023

This seems to reproduce it: ablatner/windows-runner-test#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
Copy link
Author

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

@ablatner
Copy link
Author

ablatner commented Mar 5, 2024

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

@gowridurgad
Copy link
Contributor

Hi @ablatner, The error occurs because setuptools.extern no longer includes the packaging module. This change in the setuptools library causes the ModuleNotFoundError. The setuptools library has stopped vendoring the packaging module internally, which means it is no longer accessible via setuptools.extern. For reference please visit pypa/setuptools#4457.

To resolve this, modify the script to install and import the packaging module directly. This ensures the required module is available and avoids relying on internal modules within setuptools.

import subprocess
import sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'packaging'])
from packaging import version
print("Hello world")

@gowridurgad
Copy link
Contributor

Hi @ablatner, Just a gentle reminder regarding this issue, If you have any updates or need further assistance, Please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants