Conda-build: "numpy=1.11" is enforced if "numpy" w/o version is a build requirement

Created on 15 Aug 2018  Â·  4Comments  Â·  Source: conda/conda-build

Actual Behavior

  1. I have a recipe with the following build requirements:

    requirements:
      build:
        - python
        - setuptools
        - numpy
    
  2. Our internal conda index contains numpy 1.12 and newer versions
  3. conda build <recipe> fails with:

    ...
    conda.exceptions.ResolvePackageNotFound:
      - numpy=1.11
    
    ...
        raise DependencyNeedsBuildingError(exc, subdir=subdir)
    conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-64: {'numpy=1.11'}
    
  4. The user is completely confused where the numpy=1.11 requirement comes from why the available numpy versions are ignored.
  5. Changing the requirments (in every package that requires numpy) works around the issue:

    requirements:
      build:
        - python
        - setuptools
        - numpy >= 1.12
    

    This would install, e.g., numpy=1.14.5 during the build.

Expected Behavior

Either one (in descending order):

  1. If no numpy-version is specified for the build, install the latest available version.
  2. If no numpy-version is specified for the build, try to use 1.11. Fall back to a newer version if 1.11 is not available. Maybe emit a warning.
  3. If no numpy-version is specified and it is for whatever reasons important that 1.11 is used in this case, emit a proper error message that tells users what the actual problem is and how to fix it.

Steps to Reproduce

$ mkdir /tmp/example
$ vim /tmp/example/meta.yaml
package:
  name: example
  version: 1.0

requirements:
  build:
    - python
    - numpy
    # - numpy >=1.12

build:
  script: 'echo onoes'
$ conda build /tmp/example
Output of conda info
     active environment : None
            shell level : 0
       user config file : /home/stefan/.condarc
 populated config files : /home/stefan/emsconda/.condarc
          conda version : 4.5.9
    conda-build version : 3.12.0
         python version : 3.6.5.final.0
       base environment : /home/stefan/emsconda  (writable)
           channel URLs : https://.../conda/stable/linux-64
                          https://.../conda/stable/noarch
          package cache : /home/stefan/emsconda/pkgs
                          /home/stefan/.conda/pkgs
       envs directories : /home/stefan/emsconda/envs
                          /home/stefan/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.9 requests/2.19.1 CPython/3.6.5 Linux/4.17.11-100.fc27.x86_64 fedora/27 glibc/2.26
                UID:GID : 1119:1119
             netrc file : None
           offline mode : False

Most helpful comment

Don't use this file then? We deliberately target old numpy as it's forward compatible.

I cannot simply not use this file. This is a built-in file from conda-build. If I don't have any explicit conda_build_config.yaml files, this built-in is used.

I’m okay with keeping 1.11 as default but if this version cannot be installed, conda-build should either use any version that it can find or print a better error message. The current error message looks as if it is the user's fault b/c they have somewhere pinned numpy to 1.11.

All 4 comments

Don't use this file then? We deliberately target old numpy as it's forward
compatible.

On Wed, Aug 15, 2018, 7:41 AM Stefan Scherfke notifications@github.com
wrote:

The version 1.11 is hard-coded in
https://github.com/conda/conda-build/blob/4e6b1f68f966291770e055141252ef13aeb293c8/conda_build/variants.py#L23

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/conda/conda-build/issues/3081#issuecomment-413108272,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_pdAAu8Wx7Ye8BRX2krXLYtn3Rk4YDks5uQ8J8gaJpZM4V9ooL
.

We could probably get rid of this. We depend on conda_build_config.yaml to set this for ourselves: https://github.com/AnacondaRecipes/aggregate/blob/master/conda_build_config.yaml#L117

You should probably do the same yourself. If we remove this, your unpinned recipes will float up to the latest numpy, and they won't be backwards compatible.

Don't use this file then? We deliberately target old numpy as it's forward compatible.

I cannot simply not use this file. This is a built-in file from conda-build. If I don't have any explicit conda_build_config.yaml files, this built-in is used.

I’m okay with keeping 1.11 as default but if this version cannot be installed, conda-build should either use any version that it can find or print a better error message. The current error message looks as if it is the user's fault b/c they have somewhere pinned numpy to 1.11.

Was this page helpful?
0 / 5 - 0 ratings