CI: Work around missing 'distutils' for Python 3.12+ (GHA round two) #795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug
The "Editor Tests" workflow is failing in GitHub Actions lately.
Similar problem as #779, but circling back around to address it on the other workflow
.yml
files as well.Description of the Change
Adds a step to install the
setuptools
Python package just before any of our GitHub Actions workflows try to install dependencies.Context:
setuptools
provides a copy of thedistutils
module, whichnode-gyp
tries to import, but which was deprecated in recent Python versions and does not ship out of the box in Python 3.12+. There is a fix for this innode-gyp
10.0, but older copies of Yarn or npm come with older node-gyp, so here we are.Alternate Designs
This fix won't actually be needed for a little while on the Ubuntu-based workflows, since those are still on Python 3.8, Python 3.10, soon to be Python 3.11... Only Python 3.12+ is affected by the issue. But doing this now means it won't come back again if/when
ubuntu-latest
ships Python 3.12 or newer, I guess.So, we could undo the change to
documentation.yml
,package-tests-linux.yml
andvalidate-wasm-grammar-prs.yml
for now and probably not need the change for a little while.Possible Drawbacks
This adds 6 lines to all the GitHub Actions workflow
.yml
files, so it might seem too verbose, more noticeable on the really short workflow files. Especially the very simple Linux-only workflows that don't need the fix immediately. Only takes a second to run, though.Verification Process
CI should pass. Specifically. the "Editor Tests" workflow on macOS should start passing with this (has been failing lately), and the other workflows shouldn't start failing due to this change.
Release Notes
N/A (CI-only change) but: Fix missing 'distutils' with Python 3.12+ in GitHub Actions (round two)