Pip: Log a message when not trying to build a wheel from an sdist

Created on 7 Feb 2020  路  9Comments  路  Source: pypa/pip

Environment

  • pip version: 20.0.2
  • Python version: 3.8.0
  • OS: MacOS

Description

pip is supposed to attempt to build a wheel from an sdist, so that the installation happens through a wheel. However, when given an sdist URL, pip attempts a setup.py install without trying to build a wheel.

$ pip install https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
Collecting https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
  Using cached pycparser-2.19.tar.gz (158 kB)
Installing collected packages: pycparser
    Running setup.py install for pycparser ... done
Successfully installed pycparser-2.19

Expected behavior

pip would build a wheel for pycparser which would get cached for future installs.

awaiting PR auto-locked enhancement

All 9 comments

@pradyunsg I'm not observing the same behaviour on Linux with python 3.7:

$ pip install https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
Collecting https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
  Using cached pycparser-2.19.tar.gz (158 kB)
Building wheels for collected packages: pycparser
  Building wheel for pycparser (setup.py) ... done
  Created wheel for pycparser: filename=pycparser-2.19-py2.py3-none-any.whl size=111031 sha256=b490213fce74d45085562a9f7f9e44911b685863fe0af01aa78fae4095228ddf
  Stored in directory: /home/sbi-local/.cache/pip/wheels/fe/66/57/c13635e34b49add7436cbcc472530fa1136060b22f8f026d70
Successfully built pycparser
Installing collected packages: pycparser
Successfully installed pycparser-2.19

Could it be that wheel is not installed in your environment?

Aha! Indeed, I don't have wheel installed in this venv. I probably should've taken a closer look, given the name of the environment is: pip-build-trials. :)

(I'd probably created it a while back)

I wonder if it would make sense to log a message about why pip is not building a wheel though.

I wonder if it would make sense to log a message about why pip is not building a wheel though.

A logger.debug here would certainly make sense :+1:

I kind of feel this should be an info instead. Like how pip appends (PEP 517) when it鈥檚 choosing that code path, it鈥檇 be useful to know why it鈥檚 building wheel with a legacy code path (because there鈥檚 no pyproject.toml), or why it鈥檚 running setup.py install directly (because wheel is not present).

Yea, I think we'd want to present this by default, i.e. be a logger.info.

A logger.info is also fine by me :)

Closed by #7768. Thanks @anuditnagar!

Was this page helpful?
0 / 5 - 0 ratings