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

Log a message when not trying to build a wheel from an sdist #7709

Closed
pradyunsg opened this issue Feb 7, 2020 · 9 comments
Closed

Log a message when not trying to build a wheel from an sdist #7709

pradyunsg opened this issue Feb 7, 2020 · 9 comments
Labels
auto-locked Outdated issues that have been locked by automation state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality

Comments

@pradyunsg
Copy link
Member

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.

@pradyunsg pradyunsg added the type: enhancement Improvements to functionality label Feb 7, 2020
@pradyunsg pradyunsg changed the title pip no longer tries to build a wheel from an sdist-from-URL, prior to installation pip does not try to build a wheel from an sdist-from-URL Feb 7, 2020
@sbidoul
Copy link
Member

sbidoul commented Feb 7, 2020

@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

@sbidoul
Copy link
Member

sbidoul commented Feb 7, 2020

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

@pradyunsg
Copy link
Member Author

pradyunsg commented Feb 7, 2020

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)

@pradyunsg
Copy link
Member Author

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

@pradyunsg pradyunsg changed the title pip does not try to build a wheel from an sdist-from-URL Log a message when not trying to build a wheel from an sdist Feb 7, 2020
@pradyunsg pradyunsg added this to the Print Better Error Messages milestone Feb 7, 2020
@xavfernandez
Copy link
Member

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 👍

@uranusjr
Copy link
Member

uranusjr commented Feb 7, 2020

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

@pradyunsg
Copy link
Member Author

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

@xavfernandez
Copy link
Member

A logger.info is also fine by me :)

@pradyunsg
Copy link
Member Author

Closed by #7768. Thanks @anuditnagar!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 27, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

4 participants