mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	FAQ - removeSuffix error (#6081)
* Add FAQ entry about removeSuffix error - Closes https://github.com/inventree/InvenTree/issues/6080 * Check python version in tasks.py
This commit is contained in:
		
							
								
								
									
										29
									
								
								tasks.py
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								tasks.py
									
									
									
									
									
								
							| @@ -13,6 +13,35 @@ from platform import python_version | ||||
| from invoke import task | ||||
|  | ||||
|  | ||||
| def checkPythonVersion(): | ||||
|     """Check that the installed python version meets minimum requirements. | ||||
|  | ||||
|     If the python version is not sufficient, exits with a non-zero exit code. | ||||
|     """ | ||||
|  | ||||
|     REQ_MAJOR = 3 | ||||
|     REQ_MINOR = 9 | ||||
|  | ||||
|     version = sys.version.split(" ")[0] | ||||
|  | ||||
|     valid = True | ||||
|  | ||||
|     if sys.version_info.major < REQ_MAJOR: | ||||
|         valid = False | ||||
|  | ||||
|     elif sys.version_info.major == REQ_MAJOR and sys.version_info.minor < REQ_MINOR: | ||||
|         valid = False | ||||
|  | ||||
|     if not valid: | ||||
|         print(f"The installed python version ({version}) is not supported!") | ||||
|         print(f"InvenTree requires Python {REQ_MAJOR}.{REQ_MINOR} or above") | ||||
|         sys.exit(1) | ||||
|  | ||||
|  | ||||
| if __name__ in ['__main__', 'tasks']: | ||||
|     checkPythonVersion() | ||||
|  | ||||
|  | ||||
| def apps(): | ||||
|     """Returns a list of installed apps.""" | ||||
|     return [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user