Use a temp dir as cache dir when running tests during freezing on linux

This commit is contained in:
Kovid Goyal 2021-02-16 13:07:45 +05:30
parent 9ad5ef8b2d
commit 5fdeb3b3b4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -8,6 +8,7 @@ import shutil
import stat
import subprocess
import tarfile
import tempfile
import time
from bypy.constants import (
@ -194,7 +195,12 @@ def main():
ext_dir = globals()['ext_dir']
if not args.skip_tests:
run_tests = iv['run_tests']
with tempfile.TemporaryDirectory() as tdir:
os.environ['KITTY_CACHE_DIRECTORY'] = tdir
try:
run_tests(None, os.path.join(ext_dir, 'src'))
finally:
del os.environ['KITTY_CACHE_DIRECTORY']
env = Env(os.path.join(ext_dir, kitty_constants['appname']))
copy_libs(env)
copy_python(env)