This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: User friendly message when invoking bdist_wheel sans wheel package.
Type: enhancement Stage: resolved
Components: Distutils Versions: Python 3.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: EWDurbin, dstufft, eric.araujo
Priority: normal Keywords:

Created on 2017-12-12 22:39 by EWDurbin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4824 closed EWDurbin, 2017-12-12 22:39
Messages (5)
msg308165 - (view) Author: Ee Durbin (EWDurbin) * (Python triager) Date: 2017-12-12 22:39
Wheels are a well-known part of the Python packaging ecosystem at this point!

Many tutorials, gists, and other tools suggest to build wheels using setuptools and distutils, but may not remind users to install the wheel package.

In light of Issue 31634 being temporarily suspended and given that this does not interfere with experienced users implementing their own bdist_wheel command, it should be a welcome addition to help guide novice packagers in the right direction.

Result for a Python environment without the `wheel` package installed:

$ python3 setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'bdist_wheel'
note: The wheel package provides this command. See https://packaging.python.org/tutorials/distributing-packages/#wheels for information on packaging wheels
msg308166 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2017-12-12 22:42
I don’t know that bdist_wheel integrates with pure distutils without setuptools.  I think this PR should target setuptools (it will also make it propagate to users faster and regardless of Python version).
msg308167 - (view) Author: Ee Durbin (EWDurbin) * (Python triager) Date: 2017-12-12 22:47
bdist_wheel is implemented as a distutils.core.Command, see https://github.com/pypa/wheel/blob/3a87ecebaba765475392ae2cdfa2a51cb78360e0/wheel/bdist_wheel.py

I was unable to find a good place to transparently hook in and catch the missing command class, but I agree that setuptools would be a far faster avenue to get this out to users.

Alternatives include:
  1) implementing bdist_wheel as a command in setuptools... which would have to get out of the way or call the real command when the wheel package is installed.
  2) trying to get wheel merged into setuptools, which would be a much larger project.

I'll see what option 1 looks like!
msg308168 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2017-12-12 22:58
The devs probably choose to use distutils.Command as base class for maximum compatibility, but I suspect 99.99% of users use the setuptools integration (entry points https://github.com/pypa/wheel/blob/3a87ecebaba765475392ae2cdfa2a51cb78360e0/setup.py#L53-L54 ) rather that distutils integration (explicit cmd_class setting in setup.py or --command-packages on the command line)

I’m inclined to reject the special case in distutils and encourage you to send the patch to setuptools (a similar PR, not option 1 or 2).
msg308973 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2017-12-23 23:03
Will close soon unless someone disagrees.
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76476
2018-06-15 15:29:10eric.araujosetstatus: open -> closed
stage: resolved
2018-01-20 13:20:50TestUserEWDurbinsetstatus: pending -> open
title: User friendly message when invoking bdist_wheel sans wheel package -> User friendly message when invoking bdist_wheel sans wheel package.
2017-12-23 23:03:11eric.araujosetstatus: open -> pending
resolution: wont fix
messages: + msg308973
2017-12-12 22:58:15eric.araujosetmessages: + msg308168
2017-12-12 22:47:34EWDurbinsetmessages: + msg308167
2017-12-12 22:42:12eric.araujosetmessages: + msg308166
2017-12-12 22:39:54EWDurbincreate