forked from actions/runner-images
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macos] Remove python2 UnixTools and adjust brew symlinks (actions#8452)
- Loading branch information
1 parent
060ad13
commit b3b303d
Showing
3 changed files
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,18 @@ if is_Monterey || is_BigSur; then | |
echo "Install latest Python 2" | ||
Python2Url="https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg" | ||
download_with_retries $Python2Url "/tmp" "python2.pkg" | ||
sudo installer -pkg /tmp/python2.pkg -target / | ||
|
||
sudo installer -showChoiceChangesXML -pkg /tmp/python2.pkg -target / > /tmp/python2_choices.xml | ||
|
||
# To avoid symlink conflicts, remove tools installation in /usr/local/bin using installer choices | ||
xmllint --shell /tmp/python2_choices.xml <<EOF | ||
cd //array/dict[string[text()='org.python.Python.PythonUnixTools-2.7']]/integer | ||
set 0 | ||
save | ||
EOF | ||
|
||
sudo installer -applyChoiceChangesXML /tmp/python2_choices.xml -pkg /tmp/python2.pkg -target / | ||
|
||
pip install --upgrade pip | ||
|
||
echo "Install Python2 certificates" | ||
|
@@ -19,10 +30,8 @@ if is_Veertu; then | |
close_finder_window | ||
fi | ||
|
||
# Explicitly overwrite symlinks created by Python2 such as /usr/local/bin/2to3 since they conflict with symlinks from Python3 | ||
# https://github.com/actions/runner-images/issues/2322 | ||
echo "Brew Installing Python 3" | ||
brew_smart_install "[email protected]" || brew link --overwrite [email protected] | ||
brew_smart_install "[email protected]" | ||
|
||
echo "Installing pipx" | ||
export PIPX_BIN_DIR=/usr/local/opt/pipx_bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters