Skip to content

pytest-step in provided GitHub action prefers remote package over local #1971

Open
@lukaslueg

Description

@lukaslueg

Bug Description

The Github-action generated by Maturin may contain default steps for running pytest. The juicy parts of those pytest-step are:

set -e
pip install [package] --find-links dist --force-reinstall
pip install pytest
pytest

I noticed that CI started to fail after releasing a new version, and then adding new commits. The problem is that the pip install [package] prefers the remote package over the locally built wheel in dist if the version-number is the same. Therefor, the tests execute against an outdated package as long as the version number is not bumped. This seems highly surprising behavior.

Your maturin version (maturin --version)

1.4.0

Your Python version (python -V)

3.11

Your pip version (pip -V)

23.3

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Bump version, release to pypi
  2. Add commits
  3. The CI-pipeline provided by Maturin starts testing the pypi-provided package, instead of HEAD.
  4. Bump the package-version and push; pytest now (and only now) starts using the package built by sdist from HEAD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions