Fix in ./scripts/check_dependencies.py

- fix pytest-qt import
- replace __import__ with importlib
- fix fitz description
This commit is contained in:
Martin Zibricky 2020-09-25 15:57:21 +02:00
parent 844399b54f
commit 8786a8cc7a

View File

@ -28,6 +28,7 @@ modules, simply run this script::
$ ./check_dependencies.py $ ./check_dependencies.py
""" """
import importlib
import os import os
import sys import sys
from distutils.version import LooseVersion from distutils.version import LooseVersion
@ -104,13 +105,13 @@ OPTIONAL_MODULES = [
('pyodbc', '(ODBC support)'), ('pyodbc', '(ODBC support)'),
('psycopg2', '(PostgreSQL support)'), ('psycopg2', '(PostgreSQL support)'),
('enchant', '(spell checker)'), ('enchant', '(spell checker)'),
('fitz', '(executable-independent PDF support)'), ('fitz', '(PyMuPDF - PDF support)'),
('pysword', '(import SWORD bibles)'), ('pysword', '(import SWORD bibles)'),
('uno', '(LibreOffice/OpenOffice support)'), ('uno', '(LibreOffice/OpenOffice support)'),
# development/testing modules # development/testing modules
('jenkins', '(access jenkins api)'), ('jenkins', '(access jenkins api)'),
('pytest', '(testing framework)'), ('pytest', '(testing framework)'),
('pytest-qt', '(testing framework)'), ('pytestqt', '(testing framework)'),
('flake8', '(linter)') ('flake8', '(linter)')
] ]
@ -160,7 +161,7 @@ def check_module(mod, text='', indent=' '):
space = (31 - len(mod) - len(text)) * ' ' space = (31 - len(mod) - len(text)) * ' '
w(indent + '%s %s... ' % (mod, text) + space) w(indent + '%s %s... ' % (mod, text) + space)
try: try:
__import__(mod) importlib.import_module(mod)
w('OK') w('OK')
except ImportError: except ImportError:
w('FAIL') w('FAIL')