[macos] enable python3 (and pipx) on macOS13 (#7599)

This commit is contained in:
ilia-shipitsin
2023-05-18 09:21:55 +02:00
committed by GitHub
parent 4ca86478ee
commit f2b1fa1399
4 changed files with 38 additions and 24 deletions

View File

@@ -3,19 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
$os = Get-OSVersion
Describe "Python" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
It "Python 2 is available" {
"python --version" | Should -ReturnZeroExitCode
}
It "Python 2 is real 2.x" {
(Get-CommandResult "python --version").Output | Should -BeLike "Python 2.*"
}
It "Python 2 is installed under /usr/local/bin" {
Get-WhichTool "python" | Should -BeLike "/usr/local/bin*"
}
Describe "Python3" -Skip:($os.IsVenturaArm64) {
It "Python 3 is available" {
"python3 --version" | Should -ReturnZeroExitCode
}
@@ -24,10 +12,6 @@ Describe "Python" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
Get-WhichTool "python3" | Should -BeLike "/usr/local/bin*"
}
It "Pip 2 is available" {
"pip --version" | Should -ReturnZeroExitCode
}
It "Pip 3 is available" {
"pip3 --version" | Should -ReturnZeroExitCode
}
@@ -42,6 +26,25 @@ Describe "Python" -Skip:($os.IsVentura -or $os.IsVenturaArm64) {
$pip3Path | Should -BeExactly $python3Path
}
}
Describe "Python2" -Skip:($os.IsVenturaArm64 -or $os.IsVentura) {
It "Python 2 is available" {
"python --version" | Should -ReturnZeroExitCode
}
It "Python 2 is real 2.x" {
(Get-CommandResult "python --version").Output | Should -BeLike "Python 2.*"
}
It "Python 2 is installed under /usr/local/bin" {
Get-WhichTool "python" | Should -BeLike "/usr/local/bin*"
}
It "Pip 2 is available" {
"pip --version" | Should -ReturnZeroExitCode
}
It "2to3 symlink does not point to Python 2" {
$2to3path = (Get-ChildItem (Get-Command 2to3).Path).Target
$2to3path | Should -Not -BeLike '/Frameworks/Python.framework/Versions/2.*'