1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

wheel builder: unconditionally update req.link (#7515)

We unconditionally update the requirement
link with the build wheel (in cache), so
when build() will return build success as
well as build failure, the caller can obtain
the built wheel by looking at req.local_file_path
This commit is contained in:
Stéphane Bidoul (ACSONE) 2019-12-26 21:31:55 +01:00 committed by Christopher Hunt
parent 0292938f89
commit a4d06aecaa

View file

@ -453,6 +453,10 @@ class WheelBuilder(object):
for req, cache_dir in buildset:
wheel_file = self._build_one(req, cache_dir)
if wheel_file:
# Update the link for this.
req.link = Link(path_to_url(wheel_file))
req.local_file_path = req.link.file_path
assert req.link.is_wheel
if should_unpack:
# XXX: This is mildly duplicative with prepare_files,
# but not close enough to pull out to a single common
@ -472,10 +476,6 @@ class WheelBuilder(object):
req.source_dir = req.ensure_build_location(
self.preparer.build_dir
)
# Update the link for this.
req.link = Link(path_to_url(wheel_file))
req.local_file_path = req.link.file_path
assert req.link.is_wheel
# extract the wheel into the dir
unpack_file(req.link.file_path, req.source_dir)
else: