Skip to content

python tag issue with pip wheel / pip install / caching #7296

@sbidoul

Description

@sbidoul

A tricky issue I discovered while re-reading WheelBuilder.build.

I got to wonder why the python tag of the built wheel would depend on whether we were doing pip install (should_unpack=True) or pip wheel (should_unpack=False).

With pip 19.3.1, do this (the chosen distribution name is a pure python sdist that has no wheel PyPI):

  • pip install odoo-autodiscover (the wheel is built and cached)
  • pip wheel odoo-autodiscover (the wheel is obtained from cache: odoo_autodiscover-2.0.0-cp37-none-any.whl)

Notice the cp37 tag.

Now, empty the cache and do:

  • pip wheel odoo-autodiscover (the wheel is built and you get: odoo_autodiscover-2.0.0-py3-none-any.whl)

Notice the py3 tag.

So depending on whether the wheel was installed and cached before, the result of pip wheel is different.

This behaviour was apparently introduced in 0e240d7.

Now with systematic caching introduced in #7285, the behavior is subtly different: a py3 or cp37 wheel gets cached depending on whether pip install or pip wheel is executed first. Whereas before #7285, only cp37 could be cached, never py3.

I'm not too sure what to do with that yet, as I don't really understand the motivation of 0e240d7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: cacheDealing with cache and files in itC: wheelThe wheel format and 'pip wheel' commandauto-lockedOutdated issues that have been locked by automationtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions