Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored Jan 30, 2025
2 parents 09a5911 + c958e99 commit c986da8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
36 changes: 30 additions & 6 deletions conda_metadata_app/pages/main_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,19 @@ def provenance_urls(package_name: str, channel: str, data: dict | None = None) -
if not package_name or not data:
return [""]
if data is not None:
remote_url = data.get("rendered_recipe", {}).get("extra", {}).get("remote_url")
if remote_url:
if extra := data.get("rendered_recipe", {}).get("extra", {}): # meta.yaml
pass
elif extra := data.get("about", {}).get("extra", {}): # recipe.yaml
pass
else:
logger.warning("Did not find extra metadata section")
remote_url = extra.get("remote_url")
if remote_url := extra.get("remote_url"):
if remote_url.startswith("[email protected]:"):
remote_url = remote_url.replace("[email protected]:", "https://github.com/")
if remote_url.endswith(".git"):
remote_url = remote_url[:-4]
sha = data.get("rendered_recipe", {}).get("extra", {}).get("sha")
sha = extra.get("sha")
if sha and remote_url.startswith("https://github.com/"):
return [f"{remote_url}/commit/{sha}"]
return remote_url
Expand Down Expand Up @@ -1125,9 +1131,26 @@ def disable_button(query):
)
download = f"[artifact download]({_download_url})"
maintainers = []
for user in (
data.get("rendered_recipe", {}).get("extra", {}).get("recipe-maintainers", ["*N/A*"])
):
if recipe := data.get("rendered_recipe", {}).get("recipe"): # recipe.yaml
recipe_format = f"recipe.yaml v{recipe.get("schema_version", 1)}"
rattler_build_version = (
data.get("rendered_recipe").get("system_tools").get("rattler-build", "")
)
built_with = f"`rattler-build {rattler_build_version}`"
else:
rendered_recipe = data["rendered_recipe"]
recipe_format = "meta.yaml"
conda_build_version = data.get("about", {}).get("conda_build_version", "")
conda_version = data.get("about", {}).get("conda_version", "")
built_with = "N/A"
if conda_build_version:
built_with = f"`conda-build {conda_build_version}`"
if conda_version:
built_with += f", `conda {conda_version}`"
extra = data.get("rendered_recipe", {}).get("extra", {}) or data.get(
"rendered_recipe", {}
).get("recipe", {}).get("extra", {})
for user in extra.get("recipe-maintainers", ["*N/A*"]):
if user == "*N/A*":
maintainers.append(user)
elif "/" in user: # this is a team
Expand Down Expand Up @@ -1156,6 +1179,7 @@ def disable_button(query):
| `{channel}` | `{subdir}` | `{bar_esc(build_str)}` | `{extension}` |
| **License** | **Uploaded** | **Maintainers** | **Provenance** |
| `{bar_esc(about.get("license", "*N/A*"))}` | {uploaded} | {maintainers} | {provenance} |
| **Recipe:** | `{recipe_format}` | **Built with**: | {built_with} |
| **Links:** | {download} | {project_urls} | {dashboard_markdown_links} |
"""
)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pydantic==2.9.2
typing-extensions==4.12.2
zstandard==0.23.0
py-rattler==0.7.0
conda-forge-metadata==0.10.0
conda-forge-metadata==0.11.0
git+https://github.com/channel-mirrors/conda-oci-mirror.git@25ea3e436f0b0bc5a9c646121efafc9c68e116cd # v0.1.0
streamlit==1.39.0
streamlit-searchbox==0.1.19
Expand Down

0 comments on commit c986da8

Please sign in to comment.