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

Conda Build Templates #1095

Closed
srossross opened this issue Jul 6, 2016 · 6 comments
Closed

Conda Build Templates #1095

srossross opened this issue Jul 6, 2016 · 6 comments
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::feature request for a new feature or capability

Comments

@srossross
Copy link
Contributor

srossross commented Jul 6, 2016

Perhaps it would be good to revamp the conda build template files. And make them a first class citizen:

Some ideas:

  1. Load templates from meta.yaml.template this should result in a auto generated meta.yaml

    • This would result in better understanding of failed builds becuse of unclear template variables
  2. Currently there are two passes of the build: 1 - to fetch the build sources 2. to render the meta.yaml from the template. Perhaps we can make this more clear in the yaml file maybe using the --- yaml syntax

    # File: meta.yaml.template
    # Required information
    # This can not be templated
    source: ...
    --- 
    # Template vars
    build: 
     number: {{ var }}
  3. Allow for user contributed build extensions (conda packages) that can define template variables etc. eg:

    # File: meta.yaml.template
    source: ...
    build_ext_modules:
      - conda-build-etx-auto-build-numbers
    ---
    build:
       number: {{ my_great_build_number_generator() }}
    

    in this example conda build . would install/require the conda package conda-build-etx-auto-build-numbers to be installed into the root environment before the build starts.

cc @kalefranz @mcg1969

@srossross
Copy link
Contributor Author

I started thinking about item 3 when writing a response for Anaconda-Platform/anaconda-server#258

@srossross
Copy link
Contributor Author

cc @msarahan

@msarahan
Copy link
Contributor

msarahan commented Jul 6, 2016

I don't think you need conda-build-ext-modules. I think Jinja2's function definition as filters (http://jinja.pocoo.org/docs/dev/api/#writing-filters) will suffice, and that's something we're working on in #966. There's a nice demo at #848 (comment)

That's number 2 on my priorities, after #953. I think it will probably take me another couple of weeks to get to it.

@srossross
Copy link
Contributor Author

Thanks @msarahan That solution looks great.

It would also be nice to have reusable extension components, rather than copy the jinja_context.py file from recipe to recipe.

@msarahan
Copy link
Contributor

msarahan commented Jul 6, 2016

My hope is that there will be 2 jinja_context.py files: one global, and another per-recipe. Same with the config yaml files. We'll merge these, with the local stuff overriding the global stuff. Conda-build will probably maintain a sane base file - this might be a third, which would be overridden by both the user's global, and the recipe-local.

@kenodegard kenodegard added type::feature request for a new feature or capability and removed type::enhancement labels Jan 19, 2022
@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Jan 20, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Feb 20, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Feb 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::feature request for a new feature or capability
Projects
None yet
Development

No branches or pull requests

3 participants