我在原料的配方文件中使用了 jinja2 变量,但conda build
在与.host
requirements
>=
run
这个问题在配方部分不会发生。此外,在该host
部分中,如果
- 我不
>=
与变量一起使用 - 我将硬编码值与
>=
这是失败的康达配方 -
$ 猫食谱/meta.yaml
package:
name: dummy-conda
version: 1.1.1
source:
path: .
requirements:
host:
- python >={{python}}
run:
- python >={{python}}
我在另一个文件中添加了变量-
$ cat conda_local_config.yaml
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}}
..
或者
..
host:
- python >=3.6
..
构建工作正常!
编辑 - 我打开了一个针对 conda-build 的 github 问题以获得对此行为的官方答案 - https://github.com/conda/conda-build/issues/3544