mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
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.
This commit is contained in:
parent
f4c8462b97
commit
4b11854a2e
2 changed files with 13 additions and 18 deletions
|
@ -1,8 +1,7 @@
|
||||||
[MASTER]
|
[MASTER]
|
||||||
persistent = no
|
persistent = no
|
||||||
extension-pkg-whitelist=PyQt5,ankirspy
|
extension-pkg-whitelist=PyQt5
|
||||||
ignore = aqt/forms
|
ignore = forms
|
||||||
init-hook='from PyQt5.QtWebChannel import QWebChannel; print("successful import!"); import sys; print(sys.path)'
|
|
||||||
|
|
||||||
[TYPECHECK]
|
[TYPECHECK]
|
||||||
ignored-modules=win32file,pywintypes,socket,win32pipe
|
ignored-modules=win32file,pywintypes,socket,win32pipe
|
||||||
|
|
|
@ -1,25 +1,21 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import PyQt5
|
||||||
|
|
||||||
import PyQt5.QtCore
|
from pylint.lint import Run
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
(module, ini) = sys.argv[1:]
|
(module, ini) = sys.argv[1:]
|
||||||
ini = os.path.abspath(ini)
|
ini = os.path.abspath(ini)
|
||||||
|
|
||||||
sys.exit(
|
Run(
|
||||||
subprocess.run(
|
[
|
||||||
[
|
"qt/aqt",
|
||||||
sys.executable,
|
"--rcfile",
|
||||||
"-m",
|
ini,
|
||||||
"pylint",
|
"-j",
|
||||||
"qt/aqt/qt.py",
|
"0",
|
||||||
"--rcfile",
|
"-v",
|
||||||
ini,
|
]
|
||||||
"--extension-pkg-whitelist=PyQt5",
|
|
||||||
"-v",
|
|
||||||
],
|
|
||||||
check=False,
|
|
||||||
).returncode
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue