classification
Title: ./setup.py --help-commands should sort extra commands
Type: Stage: resolved
Components: Distutils Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Pedro Lacerda, dstufft, eric.araujo
Priority: normal Keywords: patch

Created on 2016-06-14 17:45 by Antony.Lee, last changed 2020-10-22 20:26 by Antony.Lee. This issue is now closed.

Files
File name Uploaded Description Edit
sortextra.patch Pedro Lacerda, 2016-06-16 02:09
sortcommands.patch Pedro Lacerda, 2016-06-16 02:09
Messages (3)
msg268576 - (view) Author: Antony Lee (Antony.Lee) * Date: 2016-06-14 17:45
Currently, `./setup.py --help-commands` displays extra commands in a random (dict iteration, probably?) order, as can be seen with the following minimal example:

    from distutils.command.build_py import build_py
    from distutils.core import setup

    class foo(build_py): pass
    class bar(build_py): pass

    setup(cmdclass={"foo": foo, "bar": bar})

(`./setup.py --help-commands` will sometimes display `foo` before `bar`, sometimes `bar` before `foo`.)

For consistency, and especially because setuptools adds a lot of extra commands, it would be nice if the help listing these extra commands was sorted instead.
msg268637 - (view) Author: Pedro Lacerda (Pedro Lacerda) * Date: 2016-06-16 02:09
Please look if these simple patches are acceptable. I don't know if standard commands are already in a sane order or if it also need to be sorted.
msg379338 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 20:21
This is probably better now that dicts retain insertion order.
If people still think sorting would be better, please forward the feature request to setuptools.
History
Date User Action Args
2020-10-22 20:26:11Antony.Leesetnosy: - Antony.Lee
2020-10-22 20:21:34eric.araujosetstatus: open -> closed
resolution: wont fix
messages: + msg379338

stage: resolved
2016-06-16 02:09:32Pedro Lacerdasetfiles: + sortcommands.patch
2016-06-16 02:09:24Pedro Lacerdasetfiles: + sortextra.patch

nosy: + Pedro Lacerda
messages: + msg268637

keywords: + patch
2016-06-14 17:45:47Antony.Leecreate