Skip to content

Are imports: intentionally required for Python tests? #2063

@mgorny

Description

@mgorny

I've noticed today that you can't do the following in v1 recipe:

tests:
  - python:
      pip_check: true
Error: 
  × missing field `imports`
    ╭─[recipe_root/recipe.yaml:32:16]
 31 │       - python:
 32 │ ╭─▶       pip_check: true
 33 │ │   
 34 │ ├─▶ about:
    · ╰──── here
 35 │       summary: Test asyncio code more easily.
    ╰────
  help: expected field `imports` in python test to be a list of imports

Is this intentional?

The reference doesn't say it explicitly, and neither does CEP 14. I see it's enforced in the schema, though.

I suppose it would make no sense to have a python: with no imports, if not for the fact that pip check was moved there. Admittedly, given that pip_check: true is the default, you may end up with effectively empty - python: section (which doesn't work as expected either — it's silently skipped). But still, it feels quite inconsistent that you can either have to go for imports + pip_check, or have to run pip check manually as a command in the style of v0 recipe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions