From 6fe7f54a83c59131d4e291084c3496a0c513cfaa Mon Sep 17 00:00:00 2001 From: Chris Cosby Date: Wed, 6 Mar 2019 16:46:54 -0500 Subject: [PATCH] Compress all wheel content with explicit ZIP_DEFLATED (#715) (#838) https://docs.python.org/2/library/zipfile.html#zipfile.ZipFile.writestr Note: When passing a ZipInfo instance as the zinfo_or_arcname parameter, the compression method used will be that specified in the compress_type member of the given ZipInfo instance. By default, the ZipInfo constructor sets this member to ZIP_STORED. --- poetry/masonry/builders/wheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/masonry/builders/wheel.py b/poetry/masonry/builders/wheel.py index fd7382480cd..f2ddc6113d2 100644 --- a/poetry/masonry/builders/wheel.py +++ b/poetry/masonry/builders/wheel.py @@ -259,7 +259,7 @@ def _add_file(self, wheel, full_path, rel_path): hashsum.update(buf) src.seek(0) - wheel.writestr(zinfo, src.read()) + wheel.writestr(zinfo, src.read(), compress_type=zipfile.ZIP_DEFLATED) size = os.stat(full_path).st_size hash_digest = urlsafe_b64encode(hashsum.digest()).decode("ascii").rstrip("=")