[Distutils] Install a script to <prefix>/sbin instead of <prefix>/bin

Paul Moore p.f.moore at gmail.com
Tue Dec 3 12:42:37 CET 2013


On 3 December 2013 11:27, Thomas Heller <theller at ctypes.org> wrote:
> Am 03.12.2013 09:56, schrieb Paul Moore:
>
>>
>> The "scripts" argument is generally considered obsolete - tools like
>> pip will not generate executable wrappers for scripts specified like
>> this, which means that they will not work properly on Windows.
>>
>
> The Python documentation does not mention this - neither 2.7 nor 3.x.

Fair point. It's more that "scripts" offers you absolutely no help in
writing cross-platform scripts, or wrapping scripts in exes (which,
although annoying, is necessary on Windows to avoid subtle and
frustrating issues), or otherwise doing anything beyond dumping a few
files somewhere that will end up on PATH.

The entry point mechanism introduced in setuptools, and
extended/enhanced as part of the pip/wheel work, offers a much more
robust and flexible solution.

>> You should really be using (in this case, extending) the setuptools
>> "console_scripts" entry point.
>
> More and more I get the impression that distributing (writing the setup
> script and deciding on package formats) Python libraries is currently
> nearly impossible for the mortal user.
>
> distutils, setuptools, wheels... sigh.

I feel your pain. There is work ongoing to write a "packaging user
guide" which documents best practice and sticks to providing a "one
way to do things" approach. But it's very much a work in progress at
this point, and things are changing rapidly right now, so it's some
way away from being useful yet (don't look at the section on packaging
your project unless you are fond of reading sections that say "FIXME"
- or you want to help write those sections :-))

Even as someone directly involved in pip/wheel development, I struggle
every time I need to write a setup.py. All I can say is that we're
trying to cut through the confusion as fast as we can...

Paul


More information about the Distutils-SIG mailing list