[Distutils] Installing scripts

Stefan Seefeld seefeld at sympatico.ca
Mon Jun 14 20:24:14 EDT 2004


Tim Peters wrote:
> [Fred L. Drake, Jr.]

>>I *think* we agreed that stripping a .py extension for scripts on Unix is
>>acceptable, but it's not clear that any Unix-oriented users other than
>>myself were involved in the discussion.
> 
> 
> There were two others.  One was a True Believer in extensionless scripts on
> Unix, the other liked extensions on Unix scripts (but seemingly not so
> intently as the former hated them).

ok, here is a third:

I believe it's an unfortunate fact that extensions are interpreted as
metainfo and on some systems not considered part of the name. Whenever
possible I'd vote to preserve the full filename intact, as that is a form
of the principle of least surprize.
If the user wants some platform-specific manipulation of script filenames
at install time, he should indicate that to distutils with some special
option.

>>I don't think we can simply rip off .py extensions on Unix, since that
>>changes the set of installed names for packages that support older
>>versions of Python/distutils;
> 
> 
> Have to agree that visible changes are visible.
> 
> 
>>there probably needs to be some explicit gesture that this is desired in
>>the call to distutils.core.setup() (or maybe just in setup.cfg).
>>
>>I asked about silently not installing .pyw scripts on Unix, but I've not
>>seen any responses on that issue.
> 
> 
> I responded:  -1.  You can't guess whether a .pyw script will work on Unix
> from its extension alone.

right. The very concept of an extension doesn't make much sense under unix.
I don't even know whether the 'file' utility uses that for some types, probably not.
In any case, there isn't any semantics associated with extensions, so users are free
to name their scripts however they want without the system interpreting anything
differently. That shouldn't change.

> I don't think anyone so far would object to an explicitly-triggered scheme
> to strip script extensions on Unix, although some people may be unhappy with
> distributions that choose to use it.  I think it should strip all script
> extensions (.py, .pyw, .pl, .sh, .tcl -- all extensions period).

yes, as long as it is explicit (read: user-controllable) everything is fine.
A document on 'portable packaging with distutils' will certainly help.

Regards,
		Stefan





More information about the Distutils-SIG mailing list