at 25.11-pre 1.0 kB view raw
1--- a/sipbuild/builder.py 2025-04-21 12:19:34 2+++ b/sipbuild/builder.py 2025-04-21 12:27:09 3@@ -177,16 +177,23 @@ 4 saved_cwd = os.getcwd() 5 os.chdir(wheel_build_dir) 6 7- from zipfile import ZipFile, ZIP_DEFLATED 8+ from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED 9+ import time 10 11+ epoch = int(os.environ.get('SOURCE_DATE_EPOCH', '946684800')) 12+ zip_timestamp = time.gmtime(epoch)[:6] 13+ 14 with ZipFile(wheel_path, 'w', compression=ZIP_DEFLATED) as zf: 15 for dirpath, _, filenames in os.walk('.'): 16 for filename in filenames: 17 # This will result in a name with no leading '.'. 18 name = os.path.relpath(os.path.join(dirpath, filename)) 19 20- zf.write(name) 21+ zi = ZipInfo(name, zip_timestamp) 22 23+ with open(name, 'rb') as f: 24+ zf.writestr(zi, f.read()) 25+ 26 os.chdir(saved_cwd) 27 28 return wheel_file