From d006fbc49bfe46931304736d860ade92b187e674 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Tue, 1 Sep 2020 17:32:06 -0700 Subject: [PATCH] Update Language Settings File (#13389) --- eng/scripts/Language-Settings.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 81d4f673797c..4a71a5bc18e3 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -1,10 +1,9 @@ $Language = "python" -$Lang = "python" $PackageRepository = "PyPI" $packagePattern = "*.zip" $MetadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/python-packages.csv" -function Extract-python-PkgProperties ($pkgPath, $serviceName, $pkgName) +function Get-python-PackageInfoFromRepo ($pkgPath, $serviceDirectory, $pkgName) { $pkgName = $pkgName.Replace('_', '-') if (Test-Path (Join-Path $pkgPath "setup.py")) @@ -15,7 +14,7 @@ function Extract-python-PkgProperties ($pkgPath, $serviceName, $pkgName) popd if (($setupProps -ne $null) -and ($setupProps[0] -eq $pkgName)) { - return [PackageProps]::new($setupProps[0], $setupProps[1], $pkgPath, $serviceName) + return [PackageProps]::new($setupProps[0], $setupProps[1], $pkgPath, $serviceDirectory) } } return $null @@ -25,7 +24,7 @@ function Extract-python-PkgProperties ($pkgPath, $serviceName, $pkgName) function IsPythonPackageVersionPublished($pkgId, $pkgVersion) { try { - $existingVersion = (Invoke-RestMethod -MaximumRetryCount 3 -Method "Get" -uri "https://pypi.org/pypi/$pkgId/$pkgVersion/json").info.version + $existingVersion = (Invoke-RestMethod -MaximumRetryCount 3 -RetryIntervalSec 10 -Method "Get" -uri "https://pypi.org/pypi/$pkgId/$pkgVersion/json").info.version # if existingVersion exists, then it's already been published return $True } @@ -47,7 +46,7 @@ function IsPythonPackageVersionPublished($pkgId, $pkgVersion) { } # Parse out package publishing information given a python sdist of ZIP format. -function Parse-python-Package($pkg, $workingDirectory) { +function Get-python-PackageInfoFromPackageFile ($pkg, $workingDirectory) { $pkg.Basename -match $SDIST_PACKAGE_REGEX | Out-Null $pkgId = $matches["package"] @@ -84,7 +83,7 @@ function Parse-python-Package($pkg, $workingDirectory) { } # Stage and Upload Docs to blob Storage -function StageAndUpload-python-Docs() +function Publish-python-GithubIODocs () { $PublishedDocs = Get-ChildItem "$DocLocation" | Where-Object -FilterScript {$_.Name.EndsWith(".zip")}