-
Notifications
You must be signed in to change notification settings - Fork 481
Closed
Labels
type::bugdescribes erroneous operation, use severity::* to classify the typedescribes erroneous operation, use severity::* to classify the type
Description
Checklist
- I added a descriptive title
- I searched open reports and couldn't find a duplicate
What happened?
CBC variables will be strings in JINJA Expressions no matter what type they are in the CBC file. In Selector Expressions, they will be "coerced into a reasonable type", again independent of the type chosen in the CBC file. Other available variables (such as platform booleans: win, unix, etc..) are not affected by this.
Consider the following recipe:
package:
name: var_is_int # [var == 1]
name: var_is_str # [var == "1"]
version: 1.0.0.{{ var == 1 }}
source:
url: https://github.com/conda-forge/test-feedstock/archive/refs/tags/v1.0.0.tar.gz
sha256: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
requirements:
build:
- python
- numpy
run:
- python
- numpy
test:
commands:
- python -c "import sys; print(sys.version)"
- python -c "import numpy; print(numpy.__version__)"
And accompanying CBC file:
var:
- "1"
OR
var:
- 1
No matter the type chosen for var inr the CBC, conda render will produce:
package:
name: var_is_int
version: 1.0.0.False
In other words, var is always an int in the selector expression, and always a str in the JINJA expression.
Conda Info
Conda Config
Conda list
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type::bugdescribes erroneous operation, use severity::* to classify the typedescribes erroneous operation, use severity::* to classify the type
Type
Projects
Status
Done 💪🏾