Skip to content

Commit

Permalink
Try installing 3.13t on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Oct 3, 2024
1 parent d23a8c7 commit 518ff16
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_tools/python_deploy/build_macos_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function run() {
python_dir="/Library/Frameworks/Python.framework/Versions/$python_version"
if ! [ -x "$python_dir/bin/python3" ]; then
echo "WARNING: Could not find python3: $python_dir (checking PythonT)"
# https://docs.python.org/3.13/using/mac.html#installing-free-threaded-binaries
# python3.13 introduced a free-threaded (no-GIL) `t` suffixed version.
# The install paths on macOS are different than on other operating
# systems. Just always check the other dir for now ¯\_(ツ)_/¯.
Expand Down
26 changes: 26 additions & 0 deletions build_tools/python_deploy/install_macos_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,30 @@ for python_spec in "${PYTHON_SPECS[@]}"; do
$python_exe -m pip install --upgrade delocate
done

###############################################################################
# Special case: install Python 3.13 free-threaded.
# See https://github.com/python/cpython/issues/120098, specifically
# https://github.com/python/cpython/issues/120098#issuecomment-2151122033
curl https://www.python.org/ftp/python/3.13.0/python-3.13.0rc3-macos11.pkg -o /tmp/iree_python_install/313t

cat > ./choicechanges.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>org.python.Python.PythonTFramework-3.13</string>
</dict>
</array>
</plist>
EOF

installer -pkg /tmp/iree_python_install/313t -applyChoiceChangesXML ./choicechanges.plist -target /
###############################################################################

echo "*** All done ***"

0 comments on commit 518ff16

Please sign in to comment.