Skip to content

Commit 3156e56

Browse files
author
Patrik Kopkan
committed
added news entry
fixed test failure
1 parent 1afc1c0 commit 3156e56

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

news/6340.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Added a new option `--save-wheel-names` to command `wheel`.
2+
The option takes path and creates file in which
3+
is saved the basenames of wheels outputed by `wheel` command.

src/pip/_internal/commands/wheel.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,17 @@ def run(self, options, args):
187187
"Failed to build one or more wheels"
188188
)
189189
if wb.path_to_wheelnames is not None:
190-
if len(wb.wheel_filenames) != 0:
191-
entries_to_save = wb.wheel_filenames[::]
192-
for req in requirement_set.requirements.values():
193-
if req.link.filename.endswith('whl'):
194-
entries_to_save.append(req.link.filename)
195-
196-
with open(wb.path_to_wheelnames, 'w') as file:
197-
file.write(
198-
os.linesep.join(
199-
entries_to_save
200-
) + os.linesep
201-
)
190+
entries_to_save = wb.wheel_filenames[::]
191+
for req in requirement_set.requirements.values():
192+
if req.link.filename.endswith('whl'):
193+
entries_to_save.append(req.link.filename)
194+
195+
with open(wb.path_to_wheelnames, 'w') as file:
196+
file.write(
197+
'\n'.join(
198+
entries_to_save
199+
) + '\n'
200+
)
202201

203202
except PreviousBuildDirError:
204203
options.no_clean = True

0 commit comments

Comments
 (0)