@@ -100,16 +100,30 @@ def check_packages():
100100 'test_packages' : {}
101101 }
102102
103- for package in packages_data .get ('build_packages' , []):
104- path = shutil .which (package )
105- results ['build_packages' ][package ] = {
103+ for package_info in packages_data .get ('build_packages' , []):
104+ package_name = package_info .get ('name' , package_info ) if isinstance (package_info , dict ) else package_info
105+ package_path = package_info .get ('path' , 'default' ) if isinstance (package_info , dict ) else 'default'
106+
107+ if package_path != 'default' and os .path .isfile (package_path ) and os .access (package_path , os .X_OK ):
108+ path = package_path
109+ else :
110+ path = shutil .which (package_name )
111+
112+ results ['build_packages' ][package_name ] = {
106113 'installed' : path is not None ,
107114 'path' : path
108115 }
109116
110- for package in packages_data .get ('test_packages' , []):
111- path = shutil .which (package )
112- results ['test_packages' ][package ] = {
117+ for package_info in packages_data .get ('test_packages' , []):
118+ package_name = package_info .get ('name' , package_info ) if isinstance (package_info , dict ) else package_info
119+ package_path = package_info .get ('path' , 'default' ) if isinstance (package_info , dict ) else 'default'
120+
121+ if package_path != 'default' and os .path .isfile (package_path ) and os .access (package_path , os .X_OK ):
122+ path = package_path
123+ else :
124+ path = shutil .which (package_name )
125+
126+ results ['test_packages' ][package_name ] = {
113127 'installed' : path is not None ,
114128 'path' : path
115129 }
0 commit comments