8000 Update python-tests.ps1 · actions/python-versions@8038923 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8038923

Browse files
Update python-tests.ps1
1 parent 989f865 commit 8038923

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

tests/python-tests.ps1

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,35 @@ Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
1313

1414
BeforeAll {
1515
function Analyze-MissingModules([string] $buildOutputLocation) {
16-
$searchStringStart = "Failed to build these modules:"
17-
$searchStringEnd = "running build_scripts"
18-
$pattern = "$searchStringStart(.*?)$searchStringEnd"
19-
20-
$buildContent = Get-Content -Path $buildOutputLocation
21-
$splitBuiltOutput = $buildContent -split "\n"
22-
23-
### Search for missing modules that are displayed between the search strings
24-
$regexMatch = [regex]::match($splitBuiltOutput, $pattern)
25-
if ($regexMatch.Success) {
26-
$module = $regexMatch.Groups[1].Value.Trim()
27-
Write-Host "Failed missing modules:"
28-
Write-Host $module
29-
try {
30-
$semver = [semver]"$($Version.Major).$($Version.Minor)"
31-
} catch {
32-
Write-Error "Invalid Semantic Version format: $Version"
33-
return 1
34-
}
35-
36-
if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) {
37-
Write-Host "$module $Version ignored"
38-
} else {
39-
return 1
40-
}
16+
$searchStringStart = "Failed to build these modules:"
17+
$searchStringEnd = "running build_scripts"
18+
$pattern = "$searchStringStart(.*?)$searchStringEnd"
19+
20+
$buildContent = Get-Content -Path $buildOutputLocation
21+
$splitBuiltOutput = $buildContent -split "\n"
22+
23+
### Search for missing modules that are displayed between the search strings
24+
$regexMatch = [regex]::match($splitBuiltOutput, $pattern)
25+
if ($regexMatch.Success) {
26+
$module = $regexMatch.Groups[1].Value.Trim()
27+
Write-Host "Failed missing modules:"
28+
Write-Host $module
29+
try {
30+
$semver = [semver]"$($Version.Major).$($Version.Minor)"
31+
} catch {
32+
Write-Error "Invalid Semantic Version format: $Version"
33+
return 1
4134
}
4235

43-
return 0
36+
if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) {
37+
Write-Host "$module $Version ignored"
38+
} else {
39+
return 1
40+
}
4441
}
42+
43+
return 0
44+
}
4545
}
4646

4747
Describe "Tests" {

0 commit comments

Comments
 (0)
0