question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subsequent sdist runs are reusing an old, cached wheel

See original GitHub issue

Typically during development, your package’s version doesn’t change and pip will install a cached wheel built from an older sdist. For example:

nox > python -m pip install --constraint=.nox/unit-3-8-sdist/tmp/requirements.txt file:///Users/brechtm/Documents/Code/rinohtype/dist/rinohtype-0.5.3.tar.gz#egg=rinohtype
Collecting rinohtype
  Using cached rinohtype-0.5.3-py3-none-any.whl

A solution could be to pass --no-cache-dir to pip when installing the package, though that may cause issues with older pip versions.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cjolowiczcommented, Nov 15, 2021

Fixed in #523

0reactions
brechtmcommented, May 25, 2021

When installing from an sdist, pip will first build a wheel from it. That wheel is cached, and reused when installing from an sdist with the same name/version. When you’re doing development, the package version typically doesn’t change, so you end up testing against an old version of your source code.

Hence, to reproduce:

  • Make Nox (with nox-poetry) run tests using the sdist
  • Introduce a breaking change in your source code
  • Run tests again, which will succeed despite the breaking change
Read more comments on GitHub >

github_iconTop Results From Across the Web

Wheel cache is not forward/backward compatible between ...
Installing packages and having the resulting wheels go into a cache dir with pip 22.3 produces a cache that appears to be ignored...
Read more >
Prevent pip from caching a package - python - Stack Overflow
These post-install and post-develop triggers run fine if I install the sdist, but if I compile the package to a wheel, they do...
Read more >
setup.py (legacy) - pip documentation v22.3.1
The built wheel is cached locally by pip to avoid repeated identical builds. If this wheel generation fails, pip runs setup.py clean to...
Read more >
setuptools-scm - PyPI
If your project needs to support build from sdist on older versions of ... the build cache and triggers the long-running pip install...
Read more >
pip install — pip 10.0.0.dev0 documentation
When no wheels are found for an sdist, pip will attempt to build a wheel automatically and insert it into the wheel cache....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found