[issue18970] run_setup() behavior differs from cli invocation of setup.py

Éric Araujo report at bugs.python.org
Wed Mar 12 10:11:02 CET 2014


Éric Araujo added the comment:

> The principle of least surprise suggests that run_setup() should behave equivalently
> to a command line invocation of setup.py.

That’s debatable: distutils.core.setup corresponds to a command-line invocation of setup.py, but run_setup is documented as something else: http://docs.python.org/3.4/distutils/apiref#distutils.core.run_setup

In general, distutils lends itself poorly to programmatic usage.  Can you tell more about your use case for calling run_setup directly?

> Many setup.py scripts use the idiomatic 'conditional script' stanza
> "if __name__ == '__main__'".

That’s surprising to me: setup.py scripts are not modules-that-also-work-as-scripts, only scripts.

----------
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18970>
_______________________________________


More information about the Python-bugs-list mailing list