Skip to content

Commit abef7af

Browse files
authored
apacheGH-770: Ensure updating Homebrew Python on macos-13 (apache#771)
## What's Changed If we update older Python (e.g. Python 3.12) to newer Python (e.g. Python 3.13), depended packages may update newer Python when we update old Python. Let's use newer Python -> older Python order instead to avoid the situation. Closes apache#770.
1 parent 2aef66d commit abef7af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/rc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ jobs:
221221
# llvm@14 because llvm is newer than llvm@14.
222222
brew uninstall llvm || :
223223
224+
# We can remove this when we drop support for
225+
# macos-13. because macos-14 or later uses /opt/homebrew/
226+
# not /usr/local/.
227+
#
224228
# Ensure updating python@XXX with the "--overwrite" option.
225229
# If python@XXX is updated without "--overwrite", it causes
226230
# a conflict error. Because Python 3 installed not by
@@ -229,10 +233,10 @@ jobs:
229233
# tries to replace /usr/local/bin/2to3 and so on and causes
230234
# a conflict error.
231235
brew update
232-
for python_package in $(brew list | grep python@); do
236+
for python_package in $(brew list | grep python@ | sort -r); do
233237
brew install --overwrite ${python_package}
234238
done
235-
brew install --overwrite python
239+
brew install --overwrite python3
236240
237241
if [ "$(uname -m)" = "arm64" ]; then
238242
# pkg-config formula is deprecated but it's still installed

0 commit comments

Comments
 (0)