Skip to content

Commit d6646a2

Browse files
authored
Fix pyd file name for Windows (#417)
1 parent 4802d2f commit d6646a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/fix_wheel.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import pathlib
23
import shutil
34
import subprocess
45
from glob import glob
@@ -50,6 +51,18 @@
5051
if not found_wheel_tag:
5152
raise RuntimeError("Could not find WHEEL tag")
5253

54+
# On Windows due to setuptools-rust changing how the pyd file is named, we
55+
# are renaming it back.
56+
# https://github.com/PyO3/setuptools-rust/pull/352#discussion_r1293444464
57+
# explains our exact situation, but no clear remedy.
58+
# TODO(cretz): Investigate as part of https://github.com/temporalio/sdk-python/issues/398
59+
pyd_files = glob("dist/temp/*/temporalio/bridge/*-win_amd64.pyd")
60+
if pyd_files:
61+
os.rename(
62+
pyd_files[0],
63+
pathlib.Path(pyd_files[0]).with_name("temporal_sdk_bridge.pyd"),
64+
)
65+
5366
# Write the WHEEL file
5467
with open(wheel_files[0], "w") as f:
5568
f.write("\n".join(wheel_lines))

0 commit comments

Comments
 (0)