From 81a45c3f62994394578b153cad91681090c11104 Mon Sep 17 00:00:00 2001 From: Arnaud Taffanel Date: Wed, 19 Aug 2020 14:07:28 +0200 Subject: [PATCH] #433: Add python imports check --- appveyor.yml | 2 ++ src/cfclient/gui.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 6d6aeb1f2d..531229d3cc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,8 @@ build_script: - cmd: >- python setup.py build + build\exe.win32-3.6\cfclient.exe --check-imports + python win32install\generate_nsis.py makensis win32install\cfclient.nsi diff --git a/src/cfclient/gui.py b/src/cfclient/gui.py index c7686a562a..ab6548d5e6 100644 --- a/src/cfclient/gui.py +++ b/src/cfclient/gui.py @@ -59,6 +59,10 @@ def main(): parser.add_argument('--debug', '-d', nargs=1, default='info', type=str, help="set debug level " "[minimal, info, debug, debugfile]") + parser.add_argument('--check-imports', type=bool, default=False, + const=True, nargs="?", + help="Check python imports and exit successfully" + + " (intended for CI)") args = parser.parse_args() debug = args.debug @@ -133,6 +137,10 @@ def main(): logger.info("Foundation not found. Menu will show python as " "application name") + if args.check_imports: + logger.info("All imports successful!") + sys.exit(0) + # Start up the main user-interface from .ui.main import MainUI from PyQt5.QtWidgets import QApplication