mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 03:57:32 +00:00
[macOS] Update Python script and Python3 symlink behaviour (#13174)
This commit is contained in:
@@ -54,4 +54,13 @@ foreach ($tool in $tools) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Ensure python3 and pip3 point to the latest installed Python version
|
||||||
|
# Fix for ./setup.sh script behavior for python3 and pip3 symlinks
|
||||||
|
# Only Intel images are affected since /usr/local/bin is used for Intel
|
||||||
|
# ARM images use /opt/homebrew/bin which is managed by Homebrew
|
||||||
|
Write-Host "Ensuring python3 and pip3 point to the latest installed Python version from Homebrew"
|
||||||
|
brew unlink python@3.14 && brew link python@3.14 --force --overwrite
|
||||||
|
Split-Path (readlink (which python3))
|
||||||
|
|
||||||
Invoke-PesterTests "Toolcache"
|
Invoke-PesterTests "Toolcache"
|
||||||
|
|||||||
@@ -12,16 +12,8 @@ echo "Installing Python Tooling"
|
|||||||
close_finder_window
|
close_finder_window
|
||||||
|
|
||||||
# Installing latest Homebrew Python 3 to handle python3 and pip3 symlinks
|
# Installing latest Homebrew Python 3 to handle python3 and pip3 symlinks
|
||||||
# When latest Python3 is installed as a dependency for other packages
|
|
||||||
# it does not create /usr/local/bin/python3 and /usr/local/bin/pip3
|
|
||||||
echo "Brew Installing default Python 3"
|
echo "Brew Installing default Python 3"
|
||||||
brew_smart_install "python"
|
brew_smart_install "python3"
|
||||||
|
|
||||||
# Install specific Python version
|
|
||||||
# Update symlinks for python3 and pip3 to point to the specific version
|
|
||||||
toolsetVersion=$(get_toolset_value '.python.default')
|
|
||||||
echo "Installing Python $toolsetVersion"
|
|
||||||
brew_smart_install "python@$toolsetVersion"
|
|
||||||
|
|
||||||
# Pipx has its own Python dependency
|
# Pipx has its own Python dependency
|
||||||
echo "Installing pipx"
|
echo "Installing pipx"
|
||||||
|
|||||||
@@ -26,10 +26,15 @@ Describe "Python3" {
|
|||||||
"pipx --version" | Should -ReturnZeroExitCode
|
"pipx --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Pip 3 and Python 3 came from the same brew formula" {
|
It "Pip 3 and Python 3 came from the same path prefix" {
|
||||||
$pip3Path = Split-Path (readlink (which pip3))
|
$pip3Path = Split-Path (readlink (which pip3))
|
||||||
$python3Path = Split-Path (readlink (which python3))
|
$python3Path = Split-Path (readlink (which python3))
|
||||||
$pip3Path | Should -BeExactly $python3Path
|
$pip3Path | Should -BeExactly $python3Path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "Pip 3 and Python 3 came from brew formula" {
|
||||||
|
Split-Path (readlink (which pip3)) | Should -BeLike "*/Cellar/*"
|
||||||
|
Split-Path (readlink (which python3)) | Should -BeLike "*/Cellar/*"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,9 +222,6 @@
|
|||||||
"fastlane"
|
"fastlane"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"python": {
|
|
||||||
"default": "3.13"
|
|
||||||
},
|
|
||||||
"toolcache": [
|
"toolcache": [
|
||||||
{
|
{
|
||||||
"name": "Python",
|
"name": "Python",
|
||||||
|
|||||||
@@ -226,9 +226,6 @@
|
|||||||
"fastlane"
|
"fastlane"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"python": {
|
|
||||||
"default": "3.13"
|
|
||||||
},
|
|
||||||
"toolcache": [
|
"toolcache": [
|
||||||
{
|
{
|
||||||
"name": "Python",
|
"name": "Python",
|
||||||
|
|||||||
@@ -130,9 +130,6 @@
|
|||||||
"fastlane"
|
"fastlane"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"python": {
|
|
||||||
"default": "3.13"
|
|
||||||
},
|
|
||||||
"toolcache": [
|
"toolcache": [
|
||||||
{
|
{
|
||||||
"name": "Python",
|
"name": "Python",
|
||||||
|
|||||||
Reference in New Issue
Block a user