mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Update to the latest wheel package; make code work with it
This commit is contained in:
parent
7caa807f1d
commit
e20e7f7af1
3 changed files with 11 additions and 17 deletions
|
@ -359,9 +359,9 @@ werkzeug==2.2.3 \
|
||||||
--hash=sha256:2e1ccc9417d4da358b9de6f174e3ac094391ea1d4fbef2d667865d819dfd0afe \
|
--hash=sha256:2e1ccc9417d4da358b9de6f174e3ac094391ea1d4fbef2d667865d819dfd0afe \
|
||||||
--hash=sha256:56433961bc1f12533306c624f3be5e744389ac61d722175d543e1751285da612
|
--hash=sha256:56433961bc1f12533306c624f3be5e744389ac61d722175d543e1751285da612
|
||||||
# via flask
|
# via flask
|
||||||
wheel==0.38.4 \
|
wheel==0.40.0 \
|
||||||
--hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \
|
--hash=sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873 \
|
||||||
--hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8
|
--hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247
|
||||||
# via
|
# via
|
||||||
# -r requirements.base.txt
|
# -r requirements.base.txt
|
||||||
# pip-tools
|
# pip-tools
|
||||||
|
|
|
@ -641,9 +641,9 @@ werkzeug==2.2.3 \
|
||||||
# via
|
# via
|
||||||
# -r requirements.bundle.txt
|
# -r requirements.bundle.txt
|
||||||
# flask
|
# flask
|
||||||
wheel==0.38.4 \
|
wheel==0.40.0 \
|
||||||
--hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \
|
--hash=sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873 \
|
||||||
--hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8
|
--hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247
|
||||||
# via
|
# via
|
||||||
# -r requirements.bundle.txt
|
# -r requirements.bundle.txt
|
||||||
# pip-tools
|
# pip-tools
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from email.message import EmailMessage
|
from email.message import EmailMessage
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -11,16 +12,6 @@ from zipfile import ZIP_DEFLATED, ZipInfo
|
||||||
|
|
||||||
from wheel.wheelfile import WheelFile
|
from wheel.wheelfile import WheelFile
|
||||||
|
|
||||||
|
|
||||||
class ReproducibleWheelFile(WheelFile):
|
|
||||||
def writestr(self, zinfo, *args, **kwargs):
|
|
||||||
if not isinstance(zinfo, ZipInfo):
|
|
||||||
raise ValueError("ZipInfo required")
|
|
||||||
zinfo.date_time = (1980, 1, 1, 0, 0, 0)
|
|
||||||
zinfo.create_system = 3
|
|
||||||
super().writestr(zinfo, *args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def make_message(headers, payload=None):
|
def make_message(headers, payload=None):
|
||||||
msg = EmailMessage()
|
msg = EmailMessage()
|
||||||
for name, value in headers.items():
|
for name, value in headers.items():
|
||||||
|
@ -43,7 +34,7 @@ def make_message(headers, payload=None):
|
||||||
|
|
||||||
|
|
||||||
def write_wheel_file(filename, contents):
|
def write_wheel_file(filename, contents):
|
||||||
with ReproducibleWheelFile(filename, "w") as wheel:
|
with WheelFile(filename, "w") as wheel:
|
||||||
for member_info, member_source in contents.items():
|
for member_info, member_source in contents.items():
|
||||||
if not isinstance(member_info, ZipInfo):
|
if not isinstance(member_info, ZipInfo):
|
||||||
member_info = ZipInfo(member_info)
|
member_info = ZipInfo(member_info)
|
||||||
|
@ -186,6 +177,9 @@ else:
|
||||||
entrypoints = ["anki = aqt:run"]
|
entrypoints = ["anki = aqt:run"]
|
||||||
top_level = ["aqt", "_aqt"]
|
top_level = ["aqt", "_aqt"]
|
||||||
|
|
||||||
|
# reproducible builds
|
||||||
|
os.environ["SOURCE_DATE_EPOCH"] = "0"
|
||||||
|
|
||||||
write_wheel(
|
write_wheel(
|
||||||
wheel_path,
|
wheel_path,
|
||||||
name=name,
|
name=name,
|
||||||
|
|
Loading…
Reference in a new issue