Skip to content

Commit

Permalink
Skip adding directories to RECORD with wheel tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews committed Aug 21, 2023
1 parent 2008f0b commit c85a058
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/wheel/cli/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def tags(
) as fout:
fout.comment = fin.comment # preserve the comment
for item in fin.infolist():
if item.is_dir():
continue
if item.filename == f.dist_info_path + "/RECORD":
continue
if item.filename == f.dist_info_path + "/WHEEL":
Expand Down
16 changes: 10 additions & 6 deletions tests/cli/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,15 @@ def test_permission_bits(capsys, wheelpath):
with ZipFile(str(output_file), "r") as outf:
with ZipFile(str(wheelpath), "r") as inf:
for member in inf.namelist():
if not member.endswith("/RECORD"):
out_attr = outf.getinfo(member).external_attr
inf_attr = inf.getinfo(member).external_attr
assert (
out_attr == inf_attr
), f"{member} 0x{out_attr:012o} != 0x{inf_attr:012o}"
member_info = inf.getinfo(member)
if member_info.is_dir():
continue
if member_info.filename.endswith("/RECORD"):
continue
out_attr = outf.getinfo(member).external_attr
inf_attr = member_info.external_attr
assert (
out_attr == inf_attr
), f"{member} 0x{out_attr:012o} != 0x{inf_attr:012o}"

output_file.unlink()

0 comments on commit c85a058

Please sign in to comment.