@@ -303,13 +303,19 @@ def provenance_urls(package_name: str, channel: str, data: dict | None = None) -
303
303
if not package_name or not data :
304
304
return ["" ]
305
305
if data is not None :
306
- remote_url = data .get ("rendered_recipe" , {}).get ("extra" , {}).get ("remote_url" )
307
- if remote_url :
306
+ if extra := data .get ("rendered_recipe" , {}).get ("extra" , {}): # meta.yaml
307
+ pass
308
+ elif extra := data .get ("about" , {}).get ("extra" , {}): # recipe.yaml
309
+ pass
310
+ else :
311
+ logger .warning ("Did not find extra metadata section" )
312
+ remote_url = extra .get ("remote_url" )
313
+ if remote_url := extra .get ("remote_url" ):
308
314
if remote_url .
startswith (
"[email protected] :" ):
309
315
remote_url = remote_url .
replace (
"[email protected] :" ,
"https://github.com/" )
310
316
if remote_url .endswith (".git" ):
311
317
remote_url = remote_url [:- 4 ]
312
- sha = data . get ( "rendered_recipe" , {}). get ( " extra" , {}) .get ("sha" )
318
+ sha = extra .get ("sha" )
313
319
if sha and remote_url .startswith ("https://github.com/" ):
314
320
return [f"{ remote_url } /commit/{ sha } " ]
315
321
return remote_url
@@ -1125,9 +1131,26 @@ def disable_button(query):
1125
1131
)
1126
1132
download = f"[artifact download]({ _download_url } )"
1127
1133
maintainers = []
1128
- for user in (
1129
- data .get ("rendered_recipe" , {}).get ("extra" , {}).get ("recipe-maintainers" , ["*N/A*" ])
1130
- ):
1134
+ if recipe := data .get ("rendered_recipe" , {}).get ("recipe" ): # recipe.yaml
1135
+ recipe_format = f"recipe.yaml v{ recipe .get ("schema_version" , 1 )} "
1136
+ rattler_build_version = (
1137
+ data .get ("rendered_recipe" ).get ("system_tools" ).get ("rattler-build" , "" )
1138
+ )
1139
+ built_with = f"`rattler-build { rattler_build_version } `"
1140
+ else :
1141
+ rendered_recipe = data ["rendered_recipe" ]
1142
+ recipe_format = "meta.yaml"
1143
+ conda_build_version = data .get ("about" , {}).get ("conda_build_version" , "" )
1144
+ conda_version = data .get ("about" , {}).get ("conda_version" , "" )
1145
+ built_with = "N/A"
1146
+ if conda_build_version :
1147
+ built_with = f"`conda-build { conda_build_version } `"
1148
+ if conda_version :
1149
+ built_with += f", `conda { conda_version } `"
1150
+ extra = data .get ("rendered_recipe" , {}).get ("extra" , {}) or data .get (
1151
+ "rendered_recipe" , {}
1152
+ ).get ("recipe" , {}).get ("extra" , {})
1153
+ for user in extra .get ("recipe-maintainers" , ["*N/A*" ]):
1131
1154
if user == "*N/A*" :
1132
1155
maintainers .append (user )
1133
1156
elif "/" in user : # this is a team
@@ -1156,6 +1179,7 @@ def disable_button(query):
1156
1179
| `{ channel } ` | `{ subdir } ` | `{ bar_esc (build_str )} ` | `{ extension } ` |
1157
1180
| **License** | **Uploaded** | **Maintainers** | **Provenance** |
1158
1181
| `{ bar_esc (about .get ("license" , "*N/A*" ))} ` | { uploaded } | { maintainers } | { provenance } |
1182
+ | **Recipe:** | `{ recipe_format } ` | **Built with**: | { built_with } |
1159
1183
| **Links:** | { download } | { project_urls } | { dashboard_markdown_links } |
1160
1184
"""
1161
1185
)
0 commit comments