Skip to content

Commit

Permalink
chore: attempt to fix python wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
freedmand committed Feb 25, 2024
1 parent 8060984 commit 72586f0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/make_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
class ReproducibleWheelFile(WheelFile):
# Copied from Zig make_wheels.py
def writestr(self, zinfo, *args, **kwargs):
if isinstance(zinfo, str):
# arcname provided
return self.writestr(ZipInfo(filename=zinfo, *args, **kwargs))

if not isinstance(zinfo, ZipInfo):
raise ValueError("ZipInfo required")
zinfo.date_time = time.gmtime(time.time())[0:6] # Current time
Expand Down Expand Up @@ -118,9 +122,9 @@ def write_wheel(out_dir, *, name, version, tag, metadata, description, contents)
for path in glob(os.path.join(SRC_DIR, "*.py"), recursive=True):
with open(path, "rb") as f:
file_contents = f.read()
base_contents[
os.path.join(PACKAGE_NAME, os.path.relpath(path, SRC_DIR))
] = file_contents
base_contents[os.path.join(PACKAGE_NAME, os.path.relpath(path, SRC_DIR))] = (
file_contents
)

current_platform = platform.system()
for target_platform, zig_target, wheel_platform in matrix:
Expand Down

0 comments on commit 72586f0

Please sign in to comment.