mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Add check for minimum invoke version (#8952)
This commit is contained in:
parent
640d5852e4
commit
d5928f038d
15
tasks.py
15
tasks.py
@ -11,6 +11,7 @@ from pathlib import Path
|
|||||||
from platform import python_version
|
from platform import python_version
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
import invoke
|
||||||
from invoke import Collection, task
|
from invoke import Collection, task
|
||||||
from invoke.exceptions import UnexpectedExit
|
from invoke.exceptions import UnexpectedExit
|
||||||
|
|
||||||
@ -62,6 +63,19 @@ def info(*args):
|
|||||||
print(f'\033[94m{msg}\033[0m')
|
print(f'\033[94m{msg}\033[0m')
|
||||||
|
|
||||||
|
|
||||||
|
def checkInvokeVersion():
|
||||||
|
"""Check that the installed invoke version meets minimum requirements."""
|
||||||
|
MIN_INVOKE_VERSION = '2.0.0'
|
||||||
|
|
||||||
|
min_version = tuple(map(int, MIN_INVOKE_VERSION.split('.')))
|
||||||
|
invoke_version = tuple(map(int, invoke.__version__.split('.'))) # noqa: RUF048
|
||||||
|
|
||||||
|
if invoke_version < min_version:
|
||||||
|
error(f'The installed invoke version ({invoke.__version__}) is not supported!')
|
||||||
|
error(f'InvenTree requires invoke version {MIN_INVOKE_VERSION} or above')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def checkPythonVersion():
|
def checkPythonVersion():
|
||||||
"""Check that the installed python version meets minimum requirements.
|
"""Check that the installed python version meets minimum requirements.
|
||||||
|
|
||||||
@ -86,6 +100,7 @@ def checkPythonVersion():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ in ['__main__', 'tasks']:
|
if __name__ in ['__main__', 'tasks']:
|
||||||
|
checkInvokeVersion()
|
||||||
checkPythonVersion()
|
checkPythonVersion()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user