Skip to content

Commit

Permalink
Skip adding directories to RECORD with wheel tags (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored Aug 21, 2023
1 parent 2c779d9 commit 3856f7c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Release Notes

- Fixed platform tag detection for GraalPy and 32-bit python running on an aarch64
kernel (PR by Matthieu Darbois)
- Fixed ``wheel tags`` to not list directories in ``RECORD`` files
(PR by Mike Taves)

**0.41.1 (2023-08-05)**

Expand Down
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
18 changes: 12 additions & 6 deletions tests/cli/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,17 @@ 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 3856f7c

Please sign in to comment.