From a8afece5e1e26a429ddea84db0d82acd809e694e Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Fri, 5 Mar 2021 16:25:58 -0800 Subject: [PATCH] Update get_package_properties.py logic for python 2.7 --- eng/scripts/Language-Settings.ps1 | 4 ++-- eng/scripts/get_package_properties.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index ba532b5375d0..02eace224c2d 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -8,10 +8,10 @@ $BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=con function Get-AllPackageInfoFromRepo ($serviceDirectory) { $allPackageProps = @() - $searchPath = Join-Path sdk * * setup.py + $searchPath = "sdk" if ($serviceDirectory) { - $searchPath = Join-Path sdk ${serviceDirectory} * setup.py + $searchPath = Join-Path sdk ${serviceDirectory} } $allPkgPropLines = $null diff --git a/eng/scripts/get_package_properties.py b/eng/scripts/get_package_properties.py index aa65f88d9fa2..98eccb97408d 100644 --- a/eng/scripts/get_package_properties.py +++ b/eng/scripts/get_package_properties.py @@ -11,6 +11,8 @@ parser.add_argument('-s', '--search_path', required=True, help='The scope of the search') args = parser.parse_args() - for p in glob.glob(args.search_path, recursive=True): - if os.path.basename(os.path.dirname(p)) != 'azure-mgmt' and os.path.basename(os.path.dirname(p)) != 'azure' and os.path.basename(os.path.dirname(p)) != 'azure-storage': - print(get_package_properties(os.path.dirname(p))) \ No newline at end of file + for root, dirs, files in os.walk(args.search_path): + for filename in files: + if os.path.basename(filename) == "setup.py": + if os.path.basename(root) != 'azure-mgmt' and os.path.basename(root) != 'azure' and os.path.basename(root) != 'azure-storage' and os.path.basename(root) != 'tests': + print(get_package_properties(root)) \ No newline at end of file