From 5e5de280d6924c011689755f79cab314531e2b46 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Wed, 9 Dec 2020 12:28:15 +0300 Subject: [PATCH] fix minor nitpicks --- get-new-tool-versions/get-new-tool-versions.ps1 | 5 ----- get-new-tool-versions/parsers/python-parser.psm1 | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/get-new-tool-versions/get-new-tool-versions.ps1 b/get-new-tool-versions/get-new-tool-versions.ps1 index 42f9312..9c707db 100644 --- a/get-new-tool-versions/get-new-tool-versions.ps1 +++ b/get-new-tool-versions/get-new-tool-versions.ps1 @@ -26,11 +26,6 @@ $ToolVersionParser = Get-ToolVersionsParser -ToolName $ToolName $VersionsFromDist = $ToolVersionParser.GetAvailableVersions() $VersionsFromManifest = $ToolVersionParser.GetUploadedVersions() -Write-Host "Dist" -$VersionsFromDist | ForEach-Object { Write-Host $_ } -Write-Host "Manifest" -$VersionsFromManifest | ForEach-Object { Write-Host $_ } - $VersionsToBuild = $VersionsFromDist | Where-Object { $VersionsFromManifest -notcontains $_ } if ($VersionsToBuild) { diff --git a/get-new-tool-versions/parsers/python-parser.psm1 b/get-new-tool-versions/parsers/python-parser.psm1 index e82f730..c67e5ca 100644 --- a/get-new-tool-versions/parsers/python-parser.psm1 +++ b/get-new-tool-versions/parsers/python-parser.psm1 @@ -9,7 +9,7 @@ class PythonVersionsParser: BaseVersionsParser { hidden [string[]] ParseAllAvailableVersions() { $stableVersionsUrl = "https://www.python.org/ftp/python" - $stableVersionsHtmlRaw = Invoke-WebRequest $stableVersionsUrl + $stableVersionsHtmlRaw = Invoke-WebRequest $stableVersionsUrl -MaximumRetryCount $this.ApiRetryCount -RetryIntervalSec $this.ApiRetryIntervalSeconds $stableVersionsList = $stableVersionsHtmlRaw.Links.href | Where-Object { $parsed = $null return $_.EndsWith("/") -and [SemVer]::TryParse($_.Replace("/", ""), [ref]$parsed) @@ -17,12 +17,12 @@ class PythonVersionsParser: BaseVersionsParser { return $stableVersionsList | ForEach-Object { $subVersionsUrl = "${stableVersionsUrl}/${_}" - $subVersionsHtmlRaw = Invoke-WebRequest $subVersionsUrl + $subVersionsHtmlRaw = Invoke-WebRequest $subVersionsUrl -MaximumRetryCount $this.ApiRetryCount -RetryIntervalSec $this.ApiRetryIntervalSeconds return $subVersionsHtmlRaw.Links.href | ForEach-Object { if ($_ -match "^Python-(\d+\.\d+\.\d+[a-z]{0,2}\d*)\.tgz$") { return $Matches[1] } - } | ForEach-Object { $_ } | Where-Object { $_ } + } } } @@ -48,7 +48,7 @@ class PythonVersionsParser: BaseVersionsParser { } [bool] ShouldIncludeVersion([SemVer]$Version) { - # For Go, we include all versions greater than 1.12 + # For Python, we include all versions greater than 3.9.0 return $Version -gt [SemVer]"3.9.0" } } \ No newline at end of file