Skip to content

Commit

Permalink
Fix pyd file name for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Nov 7, 2023
1 parent 4802d2f commit 29e1d1a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/fix_wheel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pathlib
import shutil
import subprocess
from glob import glob
Expand Down Expand Up @@ -50,6 +51,18 @@
if not found_wheel_tag:
raise RuntimeError("Could not find WHEEL tag")

# On Windows due to setuptools-rust changing how the pyd file is named, we
# are renaming it back.
# https://github.com/PyO3/setuptools-rust/pull/352#discussion_r1293444464
# explains our exact situation, but no clear remedy.
# TODO(cretz): Investigate as part of https://github.com/temporalio/sdk-python/issues/398
pyd_files = glob("dist/temp/*/temporalio/bridge/*-win_amd64.pyd")
if pyd_files:
os.rename(
pyd_files[0],
pathlib.Path(pyd_files[0]).with_name("temporal_sdk_bridge.pyd"),
)

# Write the WHEEL file
with open(wheel_files[0], "w") as f:
f.write("\n".join(wheel_lines))
Expand Down

0 comments on commit 29e1d1a

Please sign in to comment.