-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds pre-process phase to recipe conversion work - This will enable us to address issues that are easily fixed by modifying the recipe before parsing. This should be used as a last-resort or for problems where the cost of implementing a fix is outweighed by how many recipes are afflicted by the problem. - Simplifies some logic in `convert.py` * Adds environ[] replacement to the pre-processor step * Adds initial unit tests for pre-processor * Update conda_recipe_manager/parser/recipe_parser_convert.py Co-authored-by: Bianca Henderson <[email protected]> * Update conda_recipe_manager/parser/recipe_parser_convert.py Co-authored-by: Bianca Henderson <[email protected]> --------- Co-authored-by: Bianca Henderson <[email protected]>
- Loading branch information
1 parent
6d75c8d
commit ae34991
Showing
6 changed files
with
229 additions
and
28 deletions.
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
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
53 changes: 53 additions & 0 deletions
53
tests/test_aux_files/pre-processed-simple-recipe_environ.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,53 @@ | ||
{% set zz_non_alpha_first = 42 %} | ||
{% set name = "types-toml" %} | ||
{% set version = "0.10.8.6" %} | ||
|
||
package: | ||
name: {{ name|lower }} # [unix] | ||
|
||
build: | ||
number: 0 | ||
skip: true # [py<37] | ||
is_true: true | ||
|
||
# Comment above a top-level structure | ||
requirements: | ||
empty_field1: | ||
host: | ||
- setuptools # [unix] | ||
- fakereq # [unix] selector with comment | ||
empty_field2: # [unix and win] # selector with comment with comment symbol | ||
run: | ||
- python # not a selector | ||
empty_field3: | ||
|
||
about: | ||
summary: This is a small recipe for testing | ||
description: | | ||
This is a PEP '561 type stub package for the toml package. | ||
It can be used by type-checking tools like mypy, pyright, | ||
pytype, PyCharm, etc. to check code that uses toml. | ||
license: Apache-2.0 AND MIT | ||
|
||
multi_level: | ||
list_1: | ||
- foo | ||
# Ensure a comment in a list is supported | ||
- bar | ||
list_2: | ||
- cat | ||
- {{ env.get('baz') }} | ||
- mat | ||
list_3: | ||
- ls | ||
- sl | ||
- cowsay | ||
|
||
test_var_usage: | ||
foo: {{ version }} | ||
bar: | ||
- baz | ||
- {{ env.get("foobar") }} | ||
- blah | ||
- This {{ name }} is silly | ||
- last |
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,53 @@ | ||
{% set zz_non_alpha_first = 42 %} | ||
{% set name = "types-toml" %} | ||
{% set version = "0.10.8.6" %} | ||
|
||
package: | ||
name: {{ name|lower }} # [unix] | ||
|
||
build: | ||
number: 0 | ||
skip: true # [py<37] | ||
is_true: true | ||
|
||
# Comment above a top-level structure | ||
requirements: | ||
empty_field1: | ||
host: | ||
- setuptools # [unix] | ||
- fakereq # [unix] selector with comment | ||
empty_field2: # [unix and win] # selector with comment with comment symbol | ||
run: | ||
- python # not a selector | ||
empty_field3: | ||
|
||
about: | ||
summary: This is a small recipe for testing | ||
description: | | ||
This is a PEP '561 type stub package for the toml package. | ||
It can be used by type-checking tools like mypy, pyright, | ||
pytype, PyCharm, etc. to check code that uses toml. | ||
license: Apache-2.0 AND MIT | ||
|
||
multi_level: | ||
list_1: | ||
- foo | ||
# Ensure a comment in a list is supported | ||
- bar | ||
list_2: | ||
- cat | ||
- {{ environ['baz'] }} | ||
- mat | ||
list_3: | ||
- ls | ||
- sl | ||
- cowsay | ||
|
||
test_var_usage: | ||
foo: {{ version }} | ||
bar: | ||
- baz | ||
- {{ environ["foobar"] }} | ||
- blah | ||
- This {{ name }} is silly | ||
- last |