mirror of
https://github.com/actions/python-versions.git
synced 2025-12-12 13:43:56 +00:00
Update python-tests.ps1
This commit is contained in:
@@ -13,35 +13,35 @@ Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
|
|||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
function Analyze-MissingModules([string] $buildOutputLocation) {
|
function Analyze-MissingModules([string] $buildOutputLocation) {
|
||||||
$searchStringStart = "Failed to build these modules:"
|
$searchStringStart = "Failed to build these modules:"
|
||||||
$searchStringEnd = "running build_scripts"
|
$searchStringEnd = "running build_scripts"
|
||||||
$pattern = "$searchStringStart(.*?)$searchStringEnd"
|
$pattern = "$searchStringStart(.*?)$searchStringEnd"
|
||||||
|
|
||||||
$buildContent = Get-Content -Path $buildOutputLocation
|
$buildContent = Get-Content -Path $buildOutputLocation
|
||||||
$splitBuiltOutput = $buildContent -split "\n"
|
$splitBuiltOutput = $buildContent -split "\n"
|
||||||
|
|
||||||
### Search for missing modules that are displayed between the search strings
|
### Search for missing modules that are displayed between the search strings
|
||||||
$regexMatch = [regex]::match($splitBuiltOutput, $pattern)
|
$regexMatch = [regex]::match($splitBuiltOutput, $pattern)
|
||||||
if ($regexMatch.Success) {
|
if ($regexMatch.Success) {
|
||||||
$module = $regexMatch.Groups[1].Value.Trim()
|
$module = $regexMatch.Groups[1].Value.Trim()
|
||||||
Write-Host "Failed missing modules:"
|
Write-Host "Failed missing modules:"
|
||||||
Write-Host $module
|
Write-Host $module
|
||||||
try {
|
try {
|
||||||
$semver = [semver]"$($Version.Major).$($Version.Minor)"
|
$semver = [semver]"$($Version.Major).$($Version.Minor)"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "Invalid Semantic Version format: $Version"
|
Write-Error "Invalid Semantic Version format: $Version"
|
||||||
return 1
|
return 1
|
||||||
}
|
|
||||||
|
|
||||||
if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) {
|
|
||||||
Write-Host "$module $Version ignored"
|
|
||||||
} else {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) {
|
||||||
|
Write-Host "$module $Version ignored"
|
||||||
|
} else {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Tests" {
|
Describe "Tests" {
|
||||||
|
|||||||
Reference in New Issue
Block a user