Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Feature Request: integration with pyproject.toml #323

Closed
moqmar opened this issue Jan 27, 2023 · 0 comments · Fixed by #345
Closed

Feature Request: integration with pyproject.toml #323

moqmar opened this issue Jan 27, 2023 · 0 comments · Fixed by #345

Comments

@moqmar
Copy link
Contributor

moqmar commented Jan 27, 2023

Especially for private projects, there is not always a huge separation between python code and packaging, so in most cases we have a pyproject.toml with all the information redundant in the recipe.yaml.

Now that the recipe.yaml format is a valid YAML subset, there are two features I'd like for that:

  1. In https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#templating-with-jinja, a statement {% set data = load_setup_py_data() %} is outlined. Now that pyproject.toml becomes a common file format, I think it would be nice to have e.g. a pyproject field in the context automatically, or e.g. being able to specify it e.g. like this:
    context:
        pyproject: "{{ load_toml('pyproject.toml') }}"
    Then, it'd be easily possible to later refer to the project's metadata as a single source of truth with e.g. name: "{{ pyproject.project.name }}".
  • Would it make sense to also being able to parse the whole recipe from a section in the pyproject.toml, like [tool.boa.recipe]? This could look somewhat like this:
    [project]
    name = "example"
    [tool.boa.recipe.context]
    pyproject = "{{ load_toml('pyproject.toml') }}"
    [tool.boa.recipe.about]
    name = "{{ pyproject.project.name }}"
    [tool.boa.recipe.build]
    script = "pip install ."
    Then, boa could render the recipe from that as something like this before the build, and everything could stay in one single file:
    context:
        pyproject = "{{ load_toml('pyproject.toml') }}"
    about:
        name: "{{ pyproject.project.name }}"
    build:
        script: "pip install ."
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant