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

fix: ensure variants are used on first parsing pass #5528

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

beckermr
Copy link
Contributor

@beckermr beckermr commented Nov 6, 2024

Description

This PR ensures that variant specs are used on the first parsing pass through the recipe.

Consider this block of yaml:

requirements:
  run:
    - python {{ python_min }}.*

Currently, conda-build does NOT insert a value for python_min on the first parsing pass. This leads to an invalid spec for the version:

requirements:
  run:
    - python .*

By inserting the variants once first, we get valid specs, e.g. for python_min=3.12

requirements:
  run:
    - python 3.12.*

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 6, 2024
Copy link

codspeed-hq bot commented Nov 6, 2024

CodSpeed Performance Report

Merging #5528 will degrade performances by 10.97%

Comparing beckermr:fix-undef-jinja (4120b7f) with main (bd94b7f)

Summary

❌ 1 regressions
✅ 4 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main beckermr:fix-undef-jinja Change
test_render_recipe 25.1 s 28.2 s -10.97%

@beckermr beckermr marked this pull request as ready for review November 7, 2024 01:37
@beckermr beckermr requested a review from a team as a code owner November 7, 2024 01:37
@beckermr
Copy link
Contributor Author

beckermr commented Nov 7, 2024

@conda/builds-tools this PR is ready for review!

It fixes the first parsing round so that it uses variables instead of ignoring them. This is needed to fix edge cases in parsing.

I think the small performance regression is acceptable given this is a bug fix.

@beckermr
Copy link
Contributor Author

beckermr commented Nov 7, 2024

@jakirkham this should fix some edge cases with cuda variables that needed defaults in recipes.

@beckermr beckermr merged commit d587da5 into conda:main Nov 7, 2024
27 of 28 checks passed
@beckermr beckermr deleted the fix-undef-jinja branch November 7, 2024 11:46
@beeankha beeankha mentioned this pull request Nov 15, 2024
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

3 participants