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

[feature] additional recipe metadata #5

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

AlbertDeFusco
Copy link
Contributor

This addresses #4

You can specify recipe metadata keys in following TOML header

[tool.hatch.build.targets.conda.recipe]
...

Recipe metadata is defined in TOML syntax. The metadata is merged using deepmerge with the following strategies

recipe_merger = Merger(
    type_strategies=[
        (dict, ["merge"]),
        (list, ["append"])
    ],
    fallback_strategies=["override"],
    type_conflict_strategies=["override"]
)

Most importantly, this will append list values if the key already exists. For example you can use nested key TOML
syntax:

[tool.hatch.build.targets.conda.recipe]
requirements.run = ["anaconda-anon-usage"]
test.imports = ["my_package"]

will append the package name anaconda-anon-usage to the autogenerated run requirements and inject the test
section into the recipe before it is built.

@AlbertDeFusco AlbertDeFusco marked this pull request as draft June 6, 2024 14:23
@AlbertDeFusco
Copy link
Contributor Author

I'm going to leave this as a draft until #2 is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant