@@ -107,9 +107,11 @@ def __init__(
107107 distribution_prefix : str ,
108108 strip_path_prefixes = None ,
109109 compression = zipfile .ZIP_DEFLATED ,
110+ force_zip64 = False ,
110111 ** kwargs ,
111112 ):
112113 self ._distribution_prefix = distribution_prefix
114+ self ._force_zip64 = force_zip64
113115
114116 self ._strip_path_prefixes = strip_path_prefixes or []
115117 # Entries for the RECORD file as (filename, hash, size) tuples.
@@ -154,7 +156,7 @@ def arcname_from(name):
154156 hash = hashlib .sha256 ()
155157 size = 0
156158 with open (real_filename , "rb" ) as fsrc :
157- with self .open (zinfo , "w" ) as fdst :
159+ with self .open (zinfo , "w" , force_zip64 = self . _force_zip64 ) as fdst :
158160 while True :
159161 block = fsrc .read (2 ** 20 )
160162 if not block :
@@ -241,6 +243,7 @@ def __init__(
241243 compress ,
242244 outfile = None ,
243245 strip_path_prefixes = None ,
246+ force_zip64 = False ,
244247 ):
245248 self ._name = name
246249 self ._version = normalize_pep440 (version )
@@ -250,6 +253,7 @@ def __init__(
250253 self ._platform = platform
251254 self ._outfile = outfile
252255 self ._strip_path_prefixes = strip_path_prefixes
256+ self ._force_zip64 = force_zip64
253257 self ._compress = compress
254258 self ._wheelname_fragment_distribution_name = escape_filename_distribution_name (
255259 self ._name
@@ -268,6 +272,7 @@ def __enter__(self):
268272 distribution_prefix = self ._distribution_prefix ,
269273 strip_path_prefixes = self ._strip_path_prefixes ,
270274 compression = zipfile .ZIP_DEFLATED if self ._compress else zipfile .ZIP_STORED ,
275+ force_zip64 = self ._force_zip64 ,
271276 )
272277 return self
273278
@@ -478,6 +483,11 @@ def parse_args() -> argparse.Namespace:
478483 type = Path ,
479484 help = "Pass in the stamp info file for stamping" ,
480485 )
486+ output_group .add_argument (
487+ "--force_zip64" ,
488+ action = "store_true" ,
489+ help = "Forces usage of zip64" ,
490+ )
481491
482492 return parser .parse_args (sys .argv [1 :])
483493
@@ -536,6 +546,7 @@ def main() -> None:
536546 outfile = arguments .out ,
537547 strip_path_prefixes = strip_prefixes ,
538548 compress = not arguments .no_compress ,
549+ force_zip64 = arguments .force_zip64 ,
539550 ) as maker :
540551 for package_filename , real_filename in all_files :
541552 maker .add_file (package_filename , real_filename )
0 commit comments