[Distutils] Installing scripts

Mark W. Alexander slash at dotnetslash.net
Mon Jun 14 18:40:58 EDT 2004

On Mon, Jun 14, 2004 at 05:55:46PM -0400, Tim Peters wrote:
> [Fred L. Drake, Jr.]
> > Did we reach any conclusions regarding script installation?  I think
> > there are still some issues.
> Really <wink>?
> > 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).

I agreed on removing the extenstions on installed scripts. I believe the
other person weighed in that he prefered having the extensions with the
qualification "in a development environment".

> > 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.

So packages that are installed with "python setup.py install" won't
necessarily install over the former .py scripts. Serves 'em right for
not using bdist_* and the native package manager (insert evil laughter

> > 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.  If, e.g., it's a script that brings up a Tk UI,
> then it should work fine on Unix, but giving it a .pyw extension is the only
> way to prevent it from opening a useless new DOS box too on Windows.  Unix
> still doesn't need the extension, while Windows still does.
> Should, e.g., a .sh script be installed on Windows?  It can't work, but it
> may still be good "documentation" for multilingual developers.  Should a
> .bat script be installed on Unix?  .pl?  There's no end to this.

I think a qualified "yes, for now" followed up with smarter bdist_*
commands that support platform specific metadata tuning in setup.cfg

> > I'd like to have a better idea of how much agreement there might be
> > before starting to work on a patch.
> There's near-unanimous agreement that scripts should have appropriate
> extensions on Windows.  I noted that I'd be -1 on a scheme that attempted to
> do so by having distutils guess at appropriate extensions (so strip
> extensions that are already there, or specify appropriate extensions
> explicitly).
> 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).

As long as the shebang magic was properly managed, I agree.

Mark W. Alexander
slash at dotnetslash.net

The contents of this message authored by Mark W. Alexander are
released under the Creative Commons Attribution-NonCommercial license.
Copyright of quoted materials are retained by the original author(s).


More information about the Distutils-SIG mailing list