From 4b11854a2e38870f9f8459295eeb8ade00a29c07 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 7 Jan 2021 15:47:25 +1000 Subject: [PATCH] fix pylint in qt pylint fails to read Qt modules when invoked as a subprocess with -j 0, and it looks like I committed this in the middle of debugging the issue. Work around it by invoking pylint directly. It's still awfully slow, taking 30 seconds on a 10 core machine. --- qt/.pylintrc | 5 ++--- qt/tests/run_pylint.py | 26 +++++++++++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/qt/.pylintrc b/qt/.pylintrc index 453698df9..92771b05b 100644 --- a/qt/.pylintrc +++ b/qt/.pylintrc @@ -1,8 +1,7 @@ [MASTER] persistent = no -extension-pkg-whitelist=PyQt5,ankirspy -ignore = aqt/forms -init-hook='from PyQt5.QtWebChannel import QWebChannel; print("successful import!"); import sys; print(sys.path)' +extension-pkg-whitelist=PyQt5 +ignore = forms [TYPECHECK] ignored-modules=win32file,pywintypes,socket,win32pipe diff --git a/qt/tests/run_pylint.py b/qt/tests/run_pylint.py index ce2ddf9ca..75daa0a24 100644 --- a/qt/tests/run_pylint.py +++ b/qt/tests/run_pylint.py @@ -1,25 +1,21 @@ import os import subprocess import sys +import PyQt5 -import PyQt5.QtCore +from pylint.lint import Run if __name__ == "__main__": (module, ini) = sys.argv[1:] ini = os.path.abspath(ini) - sys.exit( - subprocess.run( - [ - sys.executable, - "-m", - "pylint", - "qt/aqt/qt.py", - "--rcfile", - ini, - "--extension-pkg-whitelist=PyQt5", - "-v", - ], - check=False, - ).returncode + Run( + [ + "qt/aqt", + "--rcfile", + ini, + "-j", + "0", + "-v", + ] )