我在给料的配方文件中使用jinja2变量,但是conda build
在与{{一起使用时,无法在host
部分的requirements
部分中识别该变量。 1}}。
在食谱的>=
部分中不会发生此问题。
此外,在run
部分中,如果
host
与变量一起使用>=
一起使用这是conda食谱,失败了-
美元猫食谱/meta.yaml
>=
我已将变量添加到另一个文件中-
$ cat conda_local_config.yaml
package:
name: dummy-conda
version: 1.1.1
source:
path: .
requirements:
host:
- python >={{python}}
run:
- python >={{python}}
并使用此命令进行构建
python:
- 3.6
失败
$ conda build -m conda_local_config.yaml recipe/
这是完整的故障日志-
...
Received dictionary as spec. Note that pip requirements are not supported in conda-build meta.yaml.
如果我将配方文件修改为此
$ conda build -m conda_local_config.yaml recipe/
No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from conda_local_config.yaml
INFO:conda_build.variants:Adding in variants from conda_local_config.yaml
Received dictionary as spec. Note that pip requirements are not supported
或
..
host:
- python {{python}}
..
构建正常!
编辑-我针对conda-build公开了一个github问题,以获取对此行为的正式答案-https://github.com/conda/conda-build/issues/3544