22_summary_
33"""
44import os
5- import subprocess # nosec B404
5+ import subprocess # nosec B404
66import glob
77import platform
88import shutil
@@ -37,7 +37,8 @@ def find_dependencies(self) -> List[str]:
3737 dependency_files = []
3838 extensions = ['.whl' , '.tar.gz' , '.zip' ]
3939 for ext in extensions :
40- dependency_files .extend (glob .glob (os .path .join (self .dependencies_folder , f'*{ ext } ' )))
40+ dependency_files .extend (glob .glob (
41+ os .path .join (self .dependencies_folder , f'*{ ext } ' )))
4142 return sorted (dependency_files )
4243
4344 def install_local_dependencies (self , venv_path : str ) -> Optional [bool ]:
@@ -57,7 +58,7 @@ def install_local_dependencies(self, venv_path: str) -> Optional[bool]:
5758 for dep in dependencies :
5859 dep_name = os .path .basename (dep )
5960 print (f"Installing { dep_name } " )
60- result = subprocess .run ( # nosec B603
61+ result = subprocess .run ( # nosec B603
6162 [pip_path , 'install' , dep ],
6263 check = True ,
6364 capture_output = True ,
@@ -86,11 +87,13 @@ def _get_pip_path(self, venv_path: str) -> str:
8687
8788 def find_python_installations (self ) -> List [str ]:
8889 """Find Python installations based on OS"""
89- return self ._find_windows_python () if self .is_windows else self ._find_linux_python ()
90+ return self ._find_windows_python (
91+ ) if self .is_windows else self ._find_linux_python ()
9092
9193 def _find_windows_python (self ) -> List [str ]:
9294 """Find Python installations on Windows"""
93- installations_with_versions : List [Tuple [str , str , Tuple [int , ...]]] = []
95+ installations_with_versions : List [
96+ Tuple [str , str , Tuple [int , ...]]] = []
9497 search_paths = [
9598 f"C:\\ Users\\ { self .username } \\ AppData\\ Local\\ Programs\\ Python\\ Python*\\ python.exe" ,
9699 "C:\\ Program Files\\ Python*\\ python.exe" ,
@@ -129,7 +132,7 @@ def _find_linux_python(self) -> List[str]:
129132 def get_python_version (self , python_path : str ) -> str :
130133 """Get Python version for a given Python executable"""
131134 try :
132- result = subprocess .run ( # nosec B603
135+ result = subprocess .run ( # nosec B603
133136 [python_path , '--version' ],
134137 capture_output = True ,
135138 text = True ,
@@ -143,7 +146,7 @@ def get_python_version(self, python_path: str) -> str:
143146 def create_venv (self , python_path : str , venv_path : str ) -> bool :
144147 """Create virtual environment using specified Python installation"""
145148 try :
146- result = subprocess .run ( # nosec B603
149+ result = subprocess .run ( # nosec B603
147150 [python_path , '-m' , 'venv' , venv_path ],
148151 check = True ,
149152 capture_output = True ,
@@ -194,7 +197,7 @@ def install_requirements(self, venv_path: str, requirements_path: Optional[str]
194197
195198 pip_path = self ._get_pip_path (venv_path )
196199 print ("\n Installing requirements..." )
197- result = subprocess .run ( # nosec B603
200+ result = subprocess .run ( # nosec B603
198201 [pip_path , 'install' , '-r' , temp_requirements ],
199202 check = True ,
200203 capture_output = True ,
0 commit comments