Move autodelete_unpacked to more logical place.

This commit is contained in:
Chris Hunt 2019-09-06 19:47:50 -04:00
parent a20a06cd34
commit b72d9f1477
1 changed files with 3 additions and 2 deletions

View File

@ -187,8 +187,6 @@ class RequirementPreparer(object):
try:
download_dir = self.download_dir
# We always delete unpacked sdists after pip ran.
autodelete_unpacked = True
if link.is_wheel and self.wheel_download_dir:
# when doing 'pip wheel` we download wheels to a
# dedicated dir.
@ -209,6 +207,9 @@ class RequirementPreparer(object):
# When installing a wheel, we use the unpacked
# wheel.
autodelete_unpacked = False
else:
# We always delete unpacked sdists after pip runs.
autodelete_unpacked = True
if autodelete_unpacked:
write_delete_marker_file(req.source_dir)