distutils icon indicating copy to clipboard operation
distutils copied to clipboard

`Distribution._show_help` documentation

Open DimitriPapadopoulos opened this issue 1 year ago • 1 comments

According to its documentation, Distribution._show_help operates on its commands argument: https://github.com/pypa/distutils/blob/38b58a5b3fc343aebdb08f46089049780de4dc44/distutils/dist.py#L624 https://github.com/pypa/distutils/blob/38b58a5b3fc343aebdb08f46089049780de4dc44/distutils/dist.py#L633-L635

However, I don't see commands used anywhere. Instead, I see Distribution._show_help iterate over its self.commands variable: https://github.com/pypa/distutils/blob/38b58a5b3fc343aebdb08f46089049780de4dc44/distutils/dist.py#L658

DimitriPapadopoulos avatar Mar 10 '24 14:03 DimitriPapadopoulos

Is it OK to get rid of the commands=[] argument and change the documentation accordingly? That won't change the current functionality.

DimitriPapadopoulos avatar Mar 10 '24 14:03 DimitriPapadopoulos

Yes, probably.

jaraco avatar Aug 02 '24 15:08 jaraco

Actually, _show_help() appears to be called with different command arguments on purpose:

https://github.com/pypa/distutils/blob/b7ee725f3a5ba336cfca89f55d8a3b7d3bf7d27b/distutils/dist.py#L488-L491

https://github.com/pypa/distutils/blob/b7ee725f3a5ba336cfca89f55d8a3b7d3bf7d27b/distutils/dist.py#L583-L585

The initial intention was to filter the commands or command class at call time. Instead, I suggest fixing _show_help() to operate on commands instead of self.commands.

DimitriPapadopoulos avatar Aug 03 '24 18:08 DimitriPapadopoulos