Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use conda_build.metadata.MetaData's get_section & get_value #5055

Merged
merged 8 commits into from
Nov 3, 2023

Conversation

kenodegard
Copy link
Contributor

Description

The MetaData object contains lots of fancy helper methods/properties (e.g. get_value and build_id). Let's attempt to more consistently use these features instead of reaching into the MetaData's internals.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Nov 2, 2023
@kenodegard kenodegard changed the title Use MetaData's get_section & get_value Use conda_build.metadata.MetaData's get_section & get_value Nov 2, 2023
@kenodegard kenodegard self-assigned this Nov 2, 2023
@@ -545,12 +543,11 @@ def meta_vars(meta, skip_build_id=False):
):
d.update(get_hg_build_info(hg_dir))

# use `get_value` to prevent early exit while name is still unresolved during rendering
d["PKG_NAME"] = meta.get_value("package/name")
d["PKG_NAME"] = meta.name()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's almost surprising these are not properties meta.name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, especially surprising when other values of MetaData are properties 🤷🏻‍♂️

@kenodegard kenodegard merged commit decbcf9 into conda:main Nov 3, 2023
21 checks passed
@kenodegard kenodegard deleted the metadata branch November 3, 2023 16:34
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Nov 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants