Skip to content

Use reusable-pytest.yml for all repos that use pytest #183

@jtherrmann

Description

@jtherrmann

Jira: https://asfdaac.atlassian.net/browse/TOOL-3144

Note: The above link is accessible only to members of ASF.


Currently, reusable-pytest.yml assumes the presence of a local Python package:

  1. It requires a local_package_name input.
  2. It runs python -m pip install --no-deps . before running pytest.

It would be nice to support non-package repos as well, e.g. https://github.com/ASFHyP3/hyp3.

With regard to (1), I would suggest renaming local_package_name to something like pytest_cov_source and make it optional with a default value of "", which means no source filtering (see the --cov documentation in pytest --help after installing pytest-cov).

With regard to (2), one option would be to remove the python -m pip install --no-deps . line from the action and require that any repos with a local package include the following in environment.yml:

  - pip:
    - -e .

Another option would be to use Pixi with the path parameter, as suggested by @jhkennedy.

Also note that any of our repos that set PYTHONPATH in Makefile would need to instead set it in environment.yml before being able to use reusable-pytest.yml (see https://asfdaac.atlassian.net/browse/TOOL-3029).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Jira TaskCreate a Jira Task for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions