Skip to content

Commit 167131b

Browse files
committed
parse the whole METADATA file for Requires-Dist entries
1 parent 7351614 commit 167131b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

python/private/pypi/whl_metadata.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ def parse_whl_metadata(contents):
5252
"version": "",
5353
}
5454
for line in contents.strip().split("\n"):
55-
if not line:
56-
# Stop parsing on first empty line, which marks the end of the
57-
# headers containing the metadata.
58-
break
59-
6055
if line.startswith(_NAME):
6156
_, _, value = line.partition(_NAME)
6257
parsed["name"] = value.strip()

tests/pypi/whl_metadata/whl_metadata_tests.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,14 @@ Version: 0.0.1
126126
Requires-Dist: bar; extra == "all"
127127
Provides-Extra: all
128128
129-
Requires-Dist: this will be ignored
129+
Requires-Dist: baz
130130
""",
131131
)
132132
got.name().equals("foo")
133133
got.version().equals("0.0.1")
134134
got.requires_dist().contains_exactly([
135135
"bar; extra == \"all\"",
136+
"baz",
136137
])
137138
got.provides_extra().contains_exactly([
138139
"all",
@@ -157,13 +158,14 @@ License: some License
157158
Requires-Dist: bar; extra == "all"
158159
Provides-Extra: all
159160
160-
Requires-Dist: this will be ignored
161+
Requires-Dist: baz
161162
""",
162163
)
163164
got.name().equals("foo")
164165
got.version().equals("0.0.1")
165166
got.requires_dist().contains_exactly([
166167
"bar; extra == \"all\"",
168+
"baz",
167169
])
168170
got.provides_extra().contains_exactly([
169171
"all",

0 commit comments

Comments
 (0)