[Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

Chris Warrick kwpolska at gmail.com
Tue Aug 8 06:56:56 EDT 2017


On 8 August 2017 at 03:30, Ben Finney <ben+python at benfinney.id.au> wrote:
> Thomas Güttler <guettliml at thomas-guettler.de> writes:
>
>> Why is "the sane default is 'use console_scripts entry-point in
>> setup.py'" not a good answer?
>
> Because third-party Setuptools is required for entry points, which means
> entry points cannot be a default choice.
>
> It may well be a good choice for many cases. But that's a different
> matter from it being a good *default* choice; it can only be a default
> choice if it's in the standard library.

While setuptools is not officially part of the stdlib, it *is*
recommended by the official documentation, the dev team, and it’s
available pretty much everywhere. setuptools can’t be in stdlib,
because it’s moving too fast for stdlib to keep up.

Look here: http://pythonwheels.com/ — 254 of the top 360 packages on
PyPI use wheels. It means that at least that many use setuptools;
sometimes with a distutils fallback, but often without one. Moreover,
many of the packages without wheels use setuptools as well.

The sane default choice is entry_points.

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16


More information about the Tutor mailing list