@@ -58,13 +58,17 @@ def get_artifact_info_as_json(
58
58
"about": the info/about.json file contents
59
59
"rendered_recipe": the fully rendered recipe at
60
60
either info/recipe/meta.yaml or info/meta.yaml
61
- as a dict
61
+ as a dict.
62
+ For rattler-build recipes, we use rendered_recipe.yaml.
62
63
"raw_recipe": the template recipe as a string from
63
64
info/recipe/meta.yaml.template - could be
64
- the rendered recipe as a string if no template was found
65
+ the rendered recipe as a string if no template was found.
66
+ For rattler-build recipes, we use recipe.yaml.
65
67
"conda_build_config": the conda_build_config.yaml used for building
66
68
the recipe at info/recipe/conda_build_config.yaml
67
- "files": a list of files in the recipe from info/files with
69
+ For rattler-build recipes, we use variant_config.yaml instead.
70
+ "files": a list of files in the recipe from info/paths.json
71
+ (or fallback to info/files if info/paths.json doesn't exist) with
68
72
elements ending in .pyc or .txt filtered out.
69
73
"""
70
74
if backend == "libcfgraph" :
@@ -138,7 +142,28 @@ def info_json_from_tar_generator(
138
142
data ["conda_build_config" ] = YAML .load (
139
143
_extract_read (tar , member , default = "{}" )
140
144
)
145
+ elif path .name == "variant_config.yaml" :
146
+ data ["conda_build_config" ] = YAML .load (
147
+ _extract_read (tar , member , default = "{}" )
148
+ )
149
+ elif path .name == "paths.json" :
150
+ paths = json .loads (_extract_read (tar , member , default = "{}" ))
151
+ paths_version = paths .get ("paths_version" , 1 )
152
+ if paths_version != 1 :
153
+ warnings .warn (
154
+ f"Unrecognized paths_version { paths_version } in paths.json" ,
155
+ RuntimeWarning ,
156
+ )
157
+ files = [p .get ("_path" , "" ) for p in paths .get ("paths" , [])]
158
+ if skip_files_suffixes :
159
+ files = [
160
+ f for f in files if not f .lower ().endswith (skip_files_suffixes )
161
+ ]
162
+ data ["files" ] = files
141
163
elif path .name == "files" :
164
+ # prefer files from paths.json if available
165
+ if data ["files" ]:
166
+ continue
142
167
files = _extract_read (tar , member , default = "" ).splitlines ()
143
168
if skip_files_suffixes :
144
169
files = [
@@ -153,6 +178,10 @@ def info_json_from_tar_generator(
153
178
data ["raw_recipe" ] = x
154
179
else :
155
180
data ["rendered_recipe" ] = YAML .load (x )
181
+ elif path .name == "recipe.yaml" :
182
+ data ["raw_recipe" ] = _extract_read (tar , member , default = "" )
183
+ elif path .name == "rendered_recipe.yaml" :
184
+ data ["rendered_recipe" ] = YAML .load (_extract_read (tar , member , default = "" ))
156
185
if data ["name" ]:
157
186
return data # type: ignore
158
187
0 commit comments