Skip to content

Commit

Permalink
fix: windows
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte committed Jul 21, 2024
1 parent 5f75005 commit 97819dc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def auto(cls):

class ARCH(Enum):
X86_64 = "x86_64"
X86 = "x86"
AMD64 = "amd64"
AARCH64 = "aarch64"
I386 = "i686"
Expand All @@ -59,6 +60,8 @@ def auto(cls, os: OS):
return cls.AMD64
return cls.X86_64
elif arch_name == "386":
if os == OS.WINDOWS:
return cls.X86
return cls.I386
elif arch_name == "arm":
return cls.ARM
Expand All @@ -77,10 +80,16 @@ def repack(_os: OS, arch: ARCH):
if _os == OS.MAC:
arch_value = f"12_0_{arch_value}"
with open(wheel_path, "w") as file:
file.write(
wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}")
)
print(wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}"))
if _os == OS.WINDOWS and arch == ARCH.X86:
file.write(
wheel.replace("py3-none-any", "py310-none-win32")
)
print(wheel.replace("py3-none-any", "py310-none-win32"))
else:
file.write(
wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}")
)
print(wheel.replace("py3-none-any", f"py310-none-{_os.value}_{arch_value}"))
subprocess.call(["wheel", "pack", WORKDIR / "dist" / fname], cwd=WORKDIR / "dist")
os.remove(WORKDIR / "dist" / wheel_name)
os.remove(WORKDIR / "dist" / (fname + ".tar.gz"))
Expand Down

0 comments on commit 97819dc

Please sign in to comment.