Skip to content

Commit 97819dc

Browse files
committed
fix: windows
1 parent 5f75005 commit 97819dc

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

repack.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def auto(cls):
4040

4141
class ARCH(Enum):
4242
X86_64 = "x86_64"
43+
X86 = "x86"
4344
AMD64 = "amd64"
4445
AARCH64 = "aarch64"
4546
I386 = "i686"
@@ -59,6 +60,8 @@ def auto(cls, os: OS):
5960
return cls.AMD64
6061
return cls.X86_64
6162
elif arch_name == "386":
63+
if os == OS.WINDOWS:
64+
return cls.X86
6265
return cls.I386
6366
elif arch_name == "arm":
6467
return cls.ARM
@@ -77,10 +80,16 @@ def repack(_os: OS, arch: ARCH):
7780
if _os == OS.MAC:
7881
arch_value = f"12_0_{arch_value}"
7982
with open(wheel_path, "w") as file:
80-
file.write(
81-
wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}")
82-
)
83-
print(wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}"))
83+
if _os == OS.WINDOWS and arch == ARCH.X86:
84+
file.write(
85+
wheel.replace("py3-none-any", "py310-none-win32")
86+
)
87+
print(wheel.replace("py3-none-any", "py310-none-win32"))
88+
else:
89+
file.write(
90+
wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}")
91+
)
92+
print(wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}"))
8493
subprocess.call(["wheel", "pack", WORKDIR / "dist" / fname], cwd=WORKDIR / "dist")
8594
os.remove(WORKDIR / "dist" / wheel_name)
8695
os.remove(WORKDIR / "dist" / (fname + ".tar.gz"))

0 commit comments

Comments
 (0)