From b87bf3c1302c6d32d050960bb924502d78f6a150 Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 2 Dec 2024 10:21:55 -0800 Subject: [PATCH] Fix build process to produce a compressed `.whl`. (#2609) --- build-backend/pex_build/setuptools/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-backend/pex_build/setuptools/build.py b/build-backend/pex_build/setuptools/build.py index b89f2b34f..ddf60f8bf 100644 --- a/build-backend/pex_build/setuptools/build.py +++ b/build-backend/pex_build/setuptools/build.py @@ -7,6 +7,7 @@ import os.path import subprocess import sys +from zipfile import ZIP_DEFLATED import pex_build import setuptools.build_meta @@ -76,7 +77,7 @@ def build_wheel( InstalledFile(path=dst, hash=Hash.create(hasher), size=os.path.getsize(src)) ) Record.write(record_path, installed_files) - with open_zip(wheel_path, "w") as zip_fp: + with open_zip(wheel_path, "w", compression=ZIP_DEFLATED) as zip_fp: def add_top_level_dir(name): # type: (str) -> None