conda构建失败,在食谱的“主机”部分中使用jinja2变量的“> =”

时间:2019-06-17 09:01:28

标签: python dependencies package anaconda conda

我在给料的配方文件中使用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

0 个答案:

没有答案