Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip adding directories to RECORD with wheel tags #559

Merged
merged 4 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()