Cleanup temporary file once it's used
@@ -127,6 +127,9 @@ class CachedEnvironmentMixin:
tar = tarfile.TarFile(tmp_filename)
tar.extractall(self.version.project.doc_path)
+ # Cleanup the temporary file
+ if os.path.exists(tmp_filename):
+ os.remove(tmp_filename)
def push_cached_environment(self):
if not self.project.has_feature(feature_id=Feature.CACHED_ENVIRONMENT):
@@ -169,6 +172,10 @@ class CachedEnvironmentMixin:
fd,
)
+ # Cleanup the temporary file
+ if os.path.exists(tmp_filename):
+ os.remove(tmp_filename)
+
class SyncRepositoryMixin:
