From d12a4b0a1a951efc98c1505889f304839166838c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Jun 2019 14:32:37 +0530 Subject: [PATCH] Test changing of update_check_interval on the CI server --- .circleci/config.yml | 2 +- setup.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ffb0a93a..70efeae2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - run: python3 test.py - run: make FAIL_WARN=-W man - run: make FAIL_WARN=-W html - - run: python3 setup.py linux-package + - run: python3 setup.py linux-package --update-check-interval=0 lin-35: docker: diff --git a/setup.py b/setup.py index 3ae279386..591ed825e 100755 --- a/setup.py +++ b/setup.py @@ -657,12 +657,13 @@ def package(args, for_bundle=False, sh_launcher=False): shutil.copytree('kitty', os.path.join(libdir, 'kitty'), ignore=src_ignore) shutil.copytree('kittens', os.path.join(libdir, 'kittens'), ignore=src_ignore) - with open(os.path.join(libdir, 'kitty/config_data.py'), 'r+', encoding='utf-8') as f: - raw = f.read() - nraw = raw.replace("update_check_interval', 24", "update_check_interval', {}".format(args.update_check_interval), 1) - if nraw == raw: - raise SystemExit('Failed to change the value of update_check_interval') - f.seek(0), f.truncate(), f.write(nraw) + if args.update_check_interval != 24.0: + with open(os.path.join(libdir, 'kitty/config_data.py'), 'r+', encoding='utf-8') as f: + raw = f.read() + nraw = raw.replace("update_check_interval', 24", "update_check_interval', {}".format(args.update_check_interval), 1) + if nraw == raw: + raise SystemExit('Failed to change the value of update_check_interval') + f.seek(0), f.truncate(), f.write(nraw) compile_python(libdir) for root, dirs, files in os.walk(libdir): for f in files: