Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
lukaslueg opened this issue Feb 28, 2024 · 4 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@lukaslueg
Copy link

lukaslueg commented Feb 28, 2024

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.
@lukaslueg lukaslueg added the bug Something isn't working label Feb 28, 2024
@messense
Copy link
Member

messense commented Apr 7, 2024

See also #1680

@baseplate-admin
Copy link

I am really tired after 72 hours of debugging.

I have commented on pip:

@baseplate-admin
Copy link

Hi @messense,

Would you be willing to switch to uv from pip?

Suggested by : pypa/pip#12110 (comment)

@messense
Copy link
Member

messense commented May 6, 2024

You can already do that by modifying the generated the CI configuration file.

Adding uv support to generate-ci is welcome, we already have uv support in maturin develop command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants