-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
print_all_pkg_names.py
56 lines (45 loc) · 1.23 KB
/
print_all_pkg_names.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import glob
import io
from contextlib import redirect_stdout, redirect_stderr
import tqdm
from wurlitzer import pipes
from cdt_config import (
CDT_PATH,
CUSTOM_CDT_PATH,
)
def _get_pkg_name(recipe):
import conda_build.api
try:
f = io.StringIO()
with redirect_stdout(f), redirect_stderr(f), pipes(stdout=f, stderr=f):
metas = conda_build.api.render(
recipe,
variant_config_files=["conda_build_config.yaml"],
bypass_env_check=True,
)
except Exception as e:
print(f.getvalue())
raise e
dist_fnames = [
"noarch/" + os.path.basename(path)
for m, _, _ in metas
for path in conda_build.api.get_output_file_paths(m)
if not m.skip()
]
return dist_fnames
def print_names():
recipes = set(
glob.glob(CDT_PATH + "/*")
+ glob.glob(CUSTOM_CDT_PATH + "/*")
)
recipes = sorted(
r for r in recipes if not r.endswith("README.md")
)
names = []
for recipe in tqdm.tqdm(recipes, desc='rendering recipes'):
names += _get_pkg_name(recipe)
for name in sorted(names):
print(name)
if __name__ == '__main__':
print_names()