File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11
11
from platform import python_version
12
12
from typing import Optional
13
13
14
+ import invoke
14
15
from invoke import Collection , task
15
16
from invoke .exceptions import UnexpectedExit
16
17
@@ -39,6 +40,19 @@ def info(*args):
39
40
print (f'\033 [94m{ msg } \033 [0m' )
40
41
41
42
43
+ def checkInvokeVersion ():
44
+ """Check that the installed invoke version meets minimum requirements."""
45
+ MIN_INVOKE_VERSION = '2.0.0'
46
+
47
+ min_version = tuple (map (int , MIN_INVOKE_VERSION .split ('.' )))
48
+ invoke_version = tuple (map (int , invoke .__version__ .split ('.' ))) # noqa: RUF048
49
+
50
+ if invoke_version < min_version :
51
+ error (f'The installed invoke version ({ invoke .__version__ } ) is not supported!' )
52
+ error (f'InvenTree requires invoke version { MIN_INVOKE_VERSION } or above' )
53
+ sys .exit (1 )
54
+
55
+
42
56
def checkPythonVersion ():
43
57
"""Check that the installed python version meets minimum requirements.
44
58
@@ -63,6 +77,7 @@ def checkPythonVersion():
63
77
64
78
65
79
if __name__ in ['__main__' , 'tasks' ]:
80
+ checkInvokeVersion ()
66
81
checkPythonVersion ()
67
82
68
83
You can’t perform that action at this time.
0 commit comments