Skip to content

Commit 3856f7c

Browse files
authored
Skip adding directories to RECORD with wheel tags (#559)
1 parent 2c779d9 commit 3856f7c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

docs/news.rst

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Release Notes
55

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

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

src/wheel/cli/tags.py

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def tags(
120120
) as fout:
121121
fout.comment = fin.comment # preserve the comment
122122
for item in fin.infolist():
123+
if item.is_dir():
124+
continue
123125
if item.filename == f.dist_info_path + "/RECORD":
124126
continue
125127
if item.filename == f.dist_info_path + "/WHEEL":

tests/cli/test_tags.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,17 @@ def test_permission_bits(capsys, wheelpath):
222222
with ZipFile(str(output_file), "r") as outf:
223223
with ZipFile(str(wheelpath), "r") as inf:
224224
for member in inf.namelist():
225-
if not member.endswith("/RECORD"):
226-
out_attr = outf.getinfo(member).external_attr
227-
inf_attr = inf.getinfo(member).external_attr
228-
assert (
229-
out_attr == inf_attr
230-
), f"{member} 0x{out_attr:012o} != 0x{inf_attr:012o}"
225+
member_info = inf.getinfo(member)
226+
if member_info.is_dir():
227+
continue
228+
229+
if member_info.filename.endswith("/RECORD"):
230+
continue
231+
232+
out_attr = outf.getinfo(member).external_attr
233+
inf_attr = member_info.external_attr
234+
assert (
235+
out_attr == inf_attr
236+
), f"{member} 0x{out_attr:012o} != 0x{inf_attr:012o}"
231237

232238
output_file.unlink()

0 commit comments

Comments
 (0)