Reverse order of checks for Python versions to run YAPF #170187
+5
−5
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.
The
yapf.sh
script checks for specific "known-to-work-with-YAPF" versions of Python to run YAPF with. On my machine, I havepython3.11
andpython3.12
(python3
is a symlink topython3.12
). However, thepython3.11
release doesn't havelib2to3
so the YAPF script fails with:On my Ubuntu machine I cannot install
lib2to3
through normal APT packages;apt install python3.11-lib2to3
fails since that package has been obsoleted. I've been able to work around this by manually editing theyapf.sh
script to not check forpython3.10
orpython3.11
first.See #158384
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.