33import json
44import subprocess
55
6+ PYTA_VERSION_PREFIX = "python-ta=="
7+ PYTA_VERSION = "2.7.0"
8+
69
710def create_environment (settings_ , env_dir , _default_env_dir ):
811 env_data = settings_ .get ("env_data" , {})
912 python_version = env_data .get ("python_version" , "3" )
10- pip_requirements = ["wheel" ] + env_data .get ("pip_requirements" , "" ).split ()
13+ env_properties = ["wheel" ] + env_data .get ("pip_requirements" , "" ).split ()
14+ pyta_version = env_data .get ("pyta_version" , PYTA_VERSION )
15+ pyta_version = PYTA_VERSION_PREFIX + pyta_version
16+ env_properties .append (pyta_version )
1117 requirements = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "requirements.txt" )
1218 pip = os .path .join (env_dir , "bin" , "pip" )
1319 subprocess .run ([f"python{ python_version } " , "-m" , "venv" , "--clear" , env_dir ], check = True )
14- subprocess .run ([pip , "install" , "-r" , requirements , * pip_requirements ], check = True )
20+ subprocess .run ([pip , "install" , "-r" , requirements , * env_properties ], check = True )
1521 return {"PYTHON" : os .path .join (env_dir , "bin" , "python3" )}
1622
1723
@@ -22,6 +28,8 @@ def settings():
2228 python_versions = settings_ ["properties" ]["env_data" ]["properties" ]["python_version" ]
2329 python_versions ["enum" ] = py_versions
2430 python_versions ["default" ] = py_versions [- 1 ]
31+ pyta_version = settings_ ["properties" ]["env_data" ]["properties" ]["pyta_version" ]
32+ pyta_version ["default" ] = PYTA_VERSION
2533 return settings_
2634
2735
0 commit comments