1

I am using a jinja2 variable in the recipe file of a feedstock, but conda build fails to recognize that variable in the host part of the requirements section when used along with >=.

This problem does not happen in the run section of recipe. Also, in the host section this problem does not happen if

  • I don't use >= along with the variable
  • I use the hardcoded value along with >=

This is the conda recipe which fails with -

$ cat recipe/meta.yaml

package:
  name: dummy-conda
  version: 1.1.1

source:
  path: .

requirements:
  host:
    - python >={{python}}
  run:
    - python >={{python}}

I have added the variable in another file -

$ cat conda_local_config.yaml

python:
  - 3.6

And use this command to build

$ conda build -m conda_local_config.yaml recipe/

which fails with

...
Received dictionary as spec.  Note that pip requirements are not supported in conda-build meta.yaml.

This is the complete failure log -

$ 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 

If I modify the recipe file to this

..
  host:
    - python {{python}}
..

or

..
  host:
    - python >=3.6
..

the build works fine!

Edit - I opened up a github issue against conda-build to get an official answer to this behavior - https://github.com/conda/conda-build/issues/3544

merv
  • 67,214
  • 13
  • 180
  • 245
sangeek
  • 11
  • 4

0 Answers0