Skip to content

Commit

Permalink
src/installer/utils.py: sort entries before writing out RECORD file
Browse files Browse the repository at this point in the history
This helps build reproducibility by ensuring the RECORD file
is the same regardless of the order of the input files.
  • Loading branch information
Alexander Kanavin committed Oct 15, 2024
1 parent 05c87b2 commit 30e1a47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/installer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def construct_record_file(
io.BytesIO(), encoding="utf-8", write_through=True, newline=""
)
writer = csv.writer(stream, delimiter=",", quotechar='"', lineterminator="\n")
for scheme, record in records:
for scheme, record in sorted(records, key=lambda x: x[1].path):
writer.writerow(record.to_row(prefix_for_scheme(scheme)))
stream.seek(0)
return stream.detach()
Expand Down

0 comments on commit 30e1a47

Please sign in to comment.