conda-incubator / conda-recipe-manager

A project for libraries and automated tools that manage and manipulate conda recipe files.
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Invalid "script: commands" in tests of generated recipe #121

Open beenje opened 1 week ago

beenje commented 1 week ago

Given the following recipe:

{% set name = "elmitec" %}
{% set version = "1.4.2.dev3+g8c30ab1.d20240913" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  path: file:///build/dist/elmitec-1.4.2.dev3+g8c30ab1.d20240913.tar.gz
  sha256: c82e5b13a77550056be9bb8917dc3999786385e3118a4a01d2cb5183e8360c2f

build:
  noarch: python
  script: python -m pip install . -vv --no-deps --no-build-isolation
  number: 0

requirements:
  host:
    - python
    - setuptools >=45
    - wheel
    - setuptools-scm >=6.2,<8
    - pip
  run:
    - python
    - numpy

test:
  imports:
    - elmitec
  commands:
    - pip check
  requires:
    - pip

about:
  home: http://www.maxiv.lu.se
  summary: An collection of API to manage the Elmitec Uview program and the Leem microscope
  license: GPL-3.0
  license_file: LICENSE.txt

crm convert outputs a line script: commands that is invalid. And my understanding is that there is no need to put pip in the tests run requirements, when pip_check is true.

$ crm convert meta.yaml
schema_version: 1

context:
  name: elmitec
  version: 1.4.2.dev3+g8c30ab1.d20240913

package:
  name: ${{ name|lower }}
  version: ${{ version }}

source:
  sha256: c82e5b13a77550056be9bb8917dc3999786385e3118a4a01d2cb5183e8360c2f
  path: file:///build/dist/elmitec-1.4.2.dev3+g8c30ab1.d20240913.tar.gz

build:
  number: 0
  noarch: python
  script: python -m pip install . -vv --no-deps --no-build-isolation

requirements:
  host:
    - python
    - setuptools >=45
    - wheel
    - setuptools-scm >=6.2,<8
    - pip
  run:
    - python
    - numpy

tests:
  - python:
      imports:
        - elmitec
      pip_check: true
  - requirements:
      run:
        - pip
    script: commands

about:
  summary: An collection of API to manage the Elmitec Uview program and the Leem microscope
  license: GPL-3.0
  license_file: LICENSE.txt
  homepage: http://www.maxiv.lu.se
schuylermartin45 commented 2 days ago

Apologies for not getting to this sooner. I've been very busy and I need to figure out why I'm not getting emails/notifications for this project.

If I had to speculate:

  1. We haven't released a new version in a while and maybe this has been fixed.
  2. There could be an edge case that when pip check is the only command given, the conversion goofs-up.

No idea when I can look into this further, but I am starting to try to organize our issues better.