-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make sure to catch jinja2 vars used in single-line
for
and `se…
…t` statements (#5447) * fix: make sure to catch jinja2 vars used in for statements and set statements * doc: add news * style: ruffen * test: added test for jinja2 w/ variants * fix: wrong section name, test makes more sense now * doc: clarify that this only covers single line statements * doc: add comment on jinja2 regex * fix: typos * doc: fix typo again * Apply suggestions from code review --------- Co-authored-by: jaimergp <[email protected]>
- Loading branch information
Showing
5 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Enhancements | ||
|
||
* <news item> | ||
|
||
### Bug fixes | ||
|
||
* Variables used in single-line jinja2 `for` and `set` statements are now properly included in the variant | ||
matrix for some edge cases. (#5447) | ||
|
||
### Deprecations | ||
|
||
* <news item> | ||
|
||
### Docs | ||
|
||
* <news item> | ||
|
||
### Other | ||
|
||
* <news item> |
27 changes: 27 additions & 0 deletions
27
tests/test-recipes/variants/jinja2_used_variables/conda_build_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CLANG_VERSION: | ||
- 16.0.6 | ||
- 17.0.6 | ||
- 18.1.8 | ||
- 19.1.0.rc1 | ||
|
||
VCVER: | ||
- 14.3 | ||
- 14.2 | ||
CL_VERSION: | ||
- 19.40.33808 | ||
- 19.29.30139 | ||
|
||
BLAH: | ||
- a | ||
- b | ||
|
||
FOO: | ||
- cdf | ||
|
||
FOOBAR: | ||
- hgf | ||
|
||
zip_keys: | ||
- | ||
- VCVER | ||
- CL_VERSION |
42 changes: 42 additions & 0 deletions
42
tests/test-recipes/variants/jinja2_used_variables/meta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% if CLANG_VERSION is not defined %} | ||
{% set CLANG_VERSION = "16.0.6" %} | ||
{% set CL_VERSION = "19.29" %} | ||
{% set VCVER = "" %} | ||
{% set FOO = "" %} | ||
{% set FOOBAR = "" %} | ||
{% endif %} | ||
{% set clang_major = CLANG_VERSION.split(".")[0] %} | ||
{% set cl_minor = CL_VERSION.split(".")[1] %} | ||
{% set vc_major = VCVER.split(".")[0] %} | ||
|
||
package: | ||
name: clang-win-activation | ||
version: {{ CLANG_VERSION }} | ||
|
||
build: | ||
number: 0 | ||
{% if clang_major|int == 16 and cl_minor|int >= 40 %} | ||
skip: true | ||
{% endif %} | ||
|
||
outputs: | ||
- name: clang_win-64 | ||
build: | ||
run_exports: | ||
strong: | ||
- vc >={{ VCVER }} | ||
requirements: | ||
run: | ||
- clang {{ CLANG_VERSION }}.* | ||
|
||
test: | ||
commands: | ||
{% for var in FOO.split() %} | ||
- echo {{ var }} | ||
{% endfor %} | ||
|
||
test: | ||
commands: | ||
{% for var in FOOBAR.split() %} | ||
- echo {{ var }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters