Handling of missing required dependency during dependency check

This commit is contained in:
Ozzieisaacs 2021-11-06 21:17:48 +04:00
parent 27e8fbd248
commit 60aa016734
3 changed files with 11 additions and 9 deletions

View File

@ -129,7 +129,7 @@ def create_app():
web_server.stop(True)
sys.exit(7)
for res in dependency_check() + dependency_check(True):
log.info('*** "{}" version does not fit the requirements. Should: {}, Found: {}, please consider updating. ***'
log.info('*** "{}" version does not fit the requirements. Should: {}, Found: {}, please consider installing required version ***'
.format(res['name'],
res['target'],
res['found']))

View File

@ -117,7 +117,6 @@ else:
Jinja2=jinja2.__version__,
pySqlite = sqlite3.version,
SQLite = sqlite3.sqlite_version,
Unidecode=unidecode_version,
)
_VERSIONS.update(ret)
_VERSIONS.update(uploader.get_versions(False))

View File

@ -38,11 +38,7 @@ def load_dependencys(optional=False):
except ImportNotFound:
if optional:
continue
'''else:
return [{'name':res.group(1),
'target': "available",
'found': "Not available"
}]'''
dep_version = "not installed"
deps.append([dep_version, res.group(1), res.group(2), res.group(3), res.group(4), res.group(5)])
return deps
@ -51,12 +47,19 @@ def dependency_check(optional=False):
d = list()
deps = load_dependencys(optional)
for dep in deps:
dep_version_int = [int(x) for x in dep[0].split('.')]
low_check = [int(x) for x in dep[3].split('.')]
try:
dep_version_int = [int(x) for x in dep[0].split('.')]
low_check = [int(x) for x in dep[3].split('.')]
high_check = [int(x) for x in dep[5].split('.')]
except AttributeError:
high_check = None
except ValueError:
d.append({'name': dep[1],
'target': "available",
'found': "Not available"
})
continue
if dep[2].strip() == "==":
if dep_version_int != low_check:
d.append({'name': dep[1],