Skip to content

Commit 913b376

Browse files
committed
fix release titling including new setuptools
1 parent 1067339 commit 913b376

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/azure-sdk-tools/ci_tools/build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,17 @@ def create_package(
189189

190190
if enable_sdist:
191191
run([sys.executable, "setup.py", "sdist", "-d", dist], cwd=setup_parsed.folder, check=True)
192+
193+
# The file normalization changes in setuptools 67.3.0 intends source distribution file names to have the
194+
# formatting a whl distributions. This patch avoids that for now.
195+
normalized_package_name = setup_parsed.name.replace("-", "_")
196+
package_for_adjustments = [f for f in os.listdir(dist) if normalized_package_name in f and f.endswith("tar.gz")]
197+
198+
if package_for_adjustments:
199+
source = os.path.join(dist, package_for_adjustments[0])
200+
destination = source.replace(normalized_package_name, setup_parsed.name)
201+
202+
os.rename(source, destination)
203+
else:
204+
logger.log(level=logging.ERROR, msg=f"Unable to find a source distribution for {setup_parsed.name} that could be renamed to un-normalized title.")
205+

0 commit comments

Comments
 (0)