Per aggiungere la tua comando, è possibile creare una sottoclasse del -command predefinita build
ed estendere i suoi sottocomandi:
class _build(build):
sub_commands = [('build_qt', None)] + build.sub_commands
...
setup(..., cmdclass={'build': _build, ...})
Documentazione (distutils.cmd. Comando):
# 'sub_commands' formalizes the notion of a "family" of commands,
# eg. "install" as the parent with sub-commands "install_lib",
# "install_headers", etc. The parent of a family of commands
# defines 'sub_commands' as a class attribute; it's a list of
# (command_name : string, predicate : unbound_method | string | None)
# tuples, where 'predicate' is a method of the parent command that
# determines whether the corresponding command is applicable in the
# current situation. (Eg. we "install_headers" is only applicable if
# we have any C header files to install.) If 'predicate' is None,
# that command is always applicable.
#
# 'sub_commands' is usually defined at the *end* of a class, because
# predicates can be unbound methods, so they must already have been
# defined. The canonical example is the "install" command.
sub_commands = []
Buona risposta, anche se potrebbe essere migliorata mostrandoci dove trovare 'build'. – user1158559
@ user1158559 corretto, grazie. – ecatmur
Lei ha guadagnato il mio upvote – user1158559