You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
The setup-python action started failing recently when installing Python 3.9 on the macos-latest.
Please note that the setup-python action is the second one to run, just after checkout (this was previously the case for 3.8, but not 3.9).
The setup-python action should successfully install Python 3.9 on macos-latest independently of the contents of the repository where the action is running.
Actual behavior:
The setup-python action fails to install Python 3.9 on macos-latest for the setuptools repository.
Please note that this problem has already been previously reported:
The assessment in #860 (comment) that the problem is being caused by setuptools itself is not completely accurate.
While it is true that old versions of setuptools did expect every frame to contain a __file__ attribute, this bug in the setuptools has been fixed around 3 years ago pypa/setuptools@137ab9d.
What seems to be happening is that the host for the action has a pre-installed, very old version, and no longer supported version of setuptools, even before the action tries to run ensurepip. Because that old version of setuptools is installed in the host, ensurepip fails.
I believe that the best solution here is either:
Guarantee that the host has the most up to date version of setuptools installed
Guarantee that the host has no version of setuptools installed
Ensure that all the installations of Python don't have any kind of "cross-contamination" regarding locations for libraries, so that an old version of setuptools does not get loaded when trying to install pip via ensurepip.
Maybe run python -m ensurepip with some form of isolation flag (like -I)?
Also note that the issue is happening on the setuptools repository specifically, which may mean the following:
The setup-python can be affected by which folders and files are present on the current working directory when the action runs...
This can be problematic because people can have all sorts of files and directories in their repository and then they might affect how the action runs.
Possible solution: temporarily cd into /tmp before running the commands on setup-python? Or use some of the isolation flags when running Python scripts (e.g. -I)?
Description:
The setup-python action started failing recently when installing Python 3.9 on the
macos-latest
.Please note that the setup-python action is the second one to run, just after checkout (this was previously the case for 3.8, but not 3.9).
https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:49
Action version:
actions/setup-python@v5 - https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:1
Platform:
Runner type:
Tools version:
Python 3.9
Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:49
Expected behavior:
The setup-python action should successfully install Python 3.9 on
macos-latest
independently of the contents of the repository where the action is running.Actual behavior:
The setup-python action fails to install Python 3.9 on
macos-latest
for the setuptools repository.Please note that this problem has already been previously reported:
#860
The assessment in #860 (comment) that the problem is being caused by setuptools itself is not completely accurate.
While it is true that old versions of
setuptools
did expect every frame to contain a__file__
attribute, this bug in the setuptools has been fixed around 3 years ago pypa/setuptools@137ab9d.What seems to be happening is that the host for the action has a pre-installed, very old version, and no longer supported version of setuptools, even before the action tries to run
ensurepip
. Because that old version of setuptools is installed in the host,ensurepip
fails.I believe that the best solution here is either:
setuptools
installedsetuptools
installedsetuptools
does not get loaded when trying to installpip
viaensurepip
.python -m ensurepip
with some form of isolation flag (like-I
)?Also note that the issue is happening on the setuptools repository specifically, which may mean the following:
cd
into/tmp
before running the commands on setup-python? Or use some of the isolation flags when running Python scripts (e.g. -I)?Please see more information in #860.
The text was updated successfully, but these errors were encountered: