File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
tools/azure-sdk-tools/ci_tools Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -194,15 +194,16 @@ def create_package(
194194 # formatting a whl distributions. This patch avoids that for now.
195195 normalized_package_name = setup_parsed .name .replace ("-" , "_" )
196196 generated_sdist_name = os .path .join (dist , f"{ normalized_package_name } -{ setup_parsed .version } .tar.gz" )
197-
198- if os .path .exists (generated_sdist_name ):
199- source = generated_sdist_name
200- destination = source .replace (normalized_package_name , setup_parsed .name )
201-
202- if os .path .exists (destination ):
203- os .remove (destination )
204-
205- os .rename (source , destination )
206- else :
207- logger .log (level = logging .ERROR , msg = f"Unable to find a source distribution for { setup_parsed .name } that could be renamed without normalization." )
197+ destination = generated_sdist_name .replace (normalized_package_name , setup_parsed .name )
198+
199+ # in cases where there is no reformatting necessary (sdk/core/corehttpp is a good example)
200+ # skip this effort
201+ if generated_sdist_name != destination :
202+ if os .path .exists (generated_sdist_name ):
203+ if os .path .exists (destination ):
204+ os .remove (destination )
205+
206+ os .rename (generated_sdist_name , destination )
207+ else :
208+ logger .log (level = logging .ERROR , msg = f"Unable to find a source distribution for { setup_parsed .name } that could be renamed without normalization." )
208209
You can’t perform that action at this time.
0 commit comments