5
5
import yaml
6
6
import json
7
7
8
+
8
9
def main ():
9
10
parser = argparse .ArgumentParser (description = "List package versions" )
10
- parser .add_argument ("--github" , help = "Format output for GitHub Actions" , action = "store_true" )
11
+ parser .add_argument (
12
+ "--github" , help = "Format output for GitHub Actions" , action = "store_true"
13
+ )
11
14
args = parser .parse_args ()
12
15
13
16
script_path = Path (__file__ ).resolve ().parent
@@ -26,29 +29,37 @@ def main():
26
29
config = yaml .safe_load (f )
27
30
28
31
for version , details in config ["versions" ].items ():
29
- infos .append ({
30
- "version" : version ,
31
- "folder" : Path (details ["folder" ]),
32
- })
32
+ infos .append (
33
+ {
34
+ "version" : version ,
35
+ "folder" : Path (details ["folder" ]),
36
+ }
37
+ )
33
38
34
39
package_infos [recipe_path .name ] = infos
35
40
36
41
if args .github :
37
- result = [
38
- {
39
- "package_version" : f"{ package } /{ infos ["version" ]} " ,
40
- "package" : package ,
41
- "version" : infos ["version" ],
42
- "conanfile" : str (Path ("recipes" ) / package / infos ["folder" ] / "conanfile.py" ),
43
- } for package in sorted (package_infos .keys ())
44
- for infos in sorted (package_infos [package ], key = lambda x : x ["version" ])
45
- ]
42
+ result = {
43
+ "packages" : [
44
+ {
45
+ "package_version" : f"{ package } /{ infos ["version" ]} " ,
46
+ "package" : package ,
47
+ "version" : infos ["version" ],
48
+ "conanfile" : str (
49
+ Path ("recipes" ) / package / infos ["folder" ] / "conanfile.py"
50
+ ),
51
+ }
52
+ for package in sorted (package_infos .keys ())
53
+ for infos in sorted (package_infos [package ], key = lambda x : x ["version" ])
54
+ ]
55
+ }
46
56
47
57
print ("packages=" + json .dumps (result ))
48
58
else :
49
59
for package in sorted (package_infos .keys ()):
50
60
infos = package_infos [package ]
51
61
print (f"{ package } : { ", " .join (sorted (info ['version' ] for info in infos ))} " )
52
62
63
+
53
64
if __name__ == "__main__" :
54
65
main ()
0 commit comments