Skip to content

Commit

Permalink
Whitespace. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Apr 25, 2024
1 parent bb22a77 commit 525f184
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions make_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from wheel.wheelfile import WheelFile
from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED


ZIG_VERSION_INFO_URL = 'https://ziglang.org/download/index.json'
ZIG_PYTHON_PLATFORMS = {
'x86_64-windows': 'win_amd64',
Expand All @@ -25,6 +26,7 @@
'armv7a-linux': 'manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l',
}


class ReproducibleWheelFile(WheelFile):
def writestr(self, zinfo_or_arcname, data, *args, **kwargs):
if isinstance(zinfo_or_arcname, ZipInfo):
Expand Down Expand Up @@ -200,6 +202,7 @@ def fetch_and_write_ziglang_wheels(
with open(wheel_path, 'rb') as wheel:
print(f' {hashlib.sha256(wheel.read()).hexdigest()} {wheel_path}')


def get_argparser():
parser = argparse.ArgumentParser(prog=__file__, description="Repackage official Zig downloads as Python wheels")
parser.add_argument('--version', default='latest',
Expand All @@ -210,10 +213,12 @@ def get_argparser():
help="platform to build for, can be repeated")
return parser


def main():
args = get_argparser().parse_args()
fetch_and_write_ziglang_wheels(outdir=args.outdir, zig_version=args.version,
wheel_version_suffix=args.suffix, platforms=args.platform)


if __name__ == '__main__':
main()

0 comments on commit 525f184

Please sign in to comment.