Globally manage EphemWheelCache temp directory

This commit is contained in:
Chris Hunt 2020-02-04 23:03:25 -05:00
parent 63743fcc30
commit 34df623016
2 changed files with 8 additions and 3 deletions

View File

@ -265,7 +265,8 @@ class EphemWheelCache(SimpleWheelCache):
def __init__(self, format_control):
# type: (FormatControl) -> None
self._temp_dir = TempDirectory(
kind=tempdir_kinds.EPHEM_WHEEL_CACHE
kind=tempdir_kinds.EPHEM_WHEEL_CACHE,
globally_managed=True,
)
super(EphemWheelCache, self).__init__(
@ -274,7 +275,7 @@ class EphemWheelCache(SimpleWheelCache):
def cleanup(self):
# type: () -> None
self._temp_dir.cleanup()
pass
class WheelCache(Cache):

View File

@ -156,7 +156,11 @@ class IndexGroupCommand(Command, SessionCommandMixin):
pip_self_version_check(session, options)
KEEPABLE_TEMPDIR_TYPES = [tempdir_kinds.BUILD_ENV, tempdir_kinds.REQ_BUILD]
KEEPABLE_TEMPDIR_TYPES = [
tempdir_kinds.BUILD_ENV,
tempdir_kinds.EPHEM_WHEEL_CACHE,
tempdir_kinds.REQ_BUILD,
]
def with_cleanup(func):