[Distutils] Adding entry points into Distutils ?
p.f.moore at gmail.com
Thu May 7 16:36:52 CEST 2009
2009/5/7 Tres Seaver <tseaver at palladion.com>:
> Eric Smith wrote:
>> Doug Hellmann wrote:
>>> On May 7, 2009, at 8:54 AM, Paul Moore wrote:
>>>> 2009/5/7 Doug Hellmann <doug.hellmann at gmail.com>:
>>>>> I would argue the other way. Why force authors of console scripts to
>>>>> with entry points instead of just installing the script as-is?
>>>> Please explain "as-is" with reference to ensuring that the script
>>>> works cross-platform. I think the benefit of entry points for scripts
>>>> is that it generates appropriate wrappers to allow use on all
>>> I write a python script call hello.py like this:
>>> #!/usr/bin/env python
>>> def main():
>>> print 'hello!'
>>> if __name__ == '__main__':
>>> Why make me define an entry point for that? I can just put it in
>>> /usr/bin or somewhere in the path on Windows and call it as "hello.py".
>>> Does setuptools give me something extra for Windows? I'm not a regular
>>> Windows user, so it's likely that there are features I don't know about.
>> Yes. It creates a .exe wrapper . By using entry points, I don't need
>> to care what the target system is. Also, /usr/bin/env might invoke the
>> wrong python.
> Exactly: using entry points for console scripts guarantees that the
> python into which the corresponding distribution is installed is the one
> used to run the script, which is *highly* desirable. Otherwise, you end
> up with the "just install everything in the system Python's
> site-packages" mess.
... and somewhere around here we end up with what I described as an
By trying to satisfy everyone's requirements, you ultimately satisfy no-one's.
Sigh. I keep meaning to avoid getting sucked back into this tar-pit,
and I keep failing :-(
Just put me down as a hearty +1 for Doug's "just deploy a script
called whatever.py" approach for standalone stuff, and using python -m
for scripts distributed as part of larger distributions.
More information about the Distutils-SIG