Globally manage temp build dir

This will let us remove the indentation associated with the `with`
statement and eventually refactor these functions more easily.
This commit is contained in:
Chris Hunt 2020-02-23 14:52:16 -05:00
parent ea47be571e
commit 45911713db
3 changed files with 24 additions and 9 deletions

View File

@ -100,9 +100,14 @@ class DownloadCommand(RequirementCommand):
req_tracker = self.enter_context(get_requirement_tracker())
with TempDirectory(
options.build_dir, delete=build_delete, kind="download"
) as directory:
directory = TempDirectory(
options.build_dir,
delete=build_delete,
kind="download",
globally_managed=True,
)
if True: # Temporary, to keep commit clean
reqs = self.get_requirements(
args,
options,

View File

@ -286,9 +286,14 @@ class InstallCommand(RequirementCommand):
req_tracker = self.enter_context(get_requirement_tracker())
with TempDirectory(
options.build_dir, delete=build_delete, kind="install"
) as directory:
directory = TempDirectory(
options.build_dir,
delete=build_delete,
kind="install",
globally_managed=True,
)
if True: # Temporary, to keep commit clean
try:
reqs = self.get_requirements(
args, options, finder, session,

View File

@ -126,9 +126,14 @@ class WheelCommand(RequirementCommand):
req_tracker = self.enter_context(get_requirement_tracker())
with TempDirectory(
options.build_dir, delete=build_delete, kind="wheel"
) as directory:
directory = TempDirectory(
options.build_dir,
delete=build_delete,
kind="wheel",
globally_managed=True,
)
if True: # Temporary, to keep commit clean
reqs = self.get_requirements(
args, options, finder, session,
wheel_cache