[Distutils] Installing scripts

Mark Hammond mhammond at skippinet.com.au
Thu Jul 1 21:59:39 EDT 2004


Tim just pointed this thread out to me, so I thought I would try and keep it
alive :)

[Fred wrote]
> --sigh--
>
> So as I understand it, you'd need an extension to be left on
> for .pyw scripts,
> but could tolerate removal of extensions for other scripts.
> This is a
> distinct case from other Unixes and from Windows.
>
> I have a patch that will strip extensions for POSIX platforms
> other than
> Darwin (including Mac OS X), only if "build_scripts
> --strip-extensions" is
> used.  Given the special cases and another issue related to
> legacy support,
> I'm not going to apply the patch.
>
> The other issue is one of supporting scripts that want to
> keep their extension
> (because they need to be command-line compatible with how they were
> previously installed) at the same time as providing scripts
> with extensions
> stripped by default.  My own expectation is that I'd want to
> ship a setup.cfg
> file that set this by default, but I'd want to exclude
> specific scripts.
> This indicates that the simple model of a boolean flag isn't
> sufficient.

How about something like:

strip_extensions = {"posix": "txt py pyw", "darwin": "txt" }

Where strip_extensions is a dictionary, keyed by the platform name (either
sys.platform or os.name - whatever makes sense.  The value is the list of
extensions that should be stripped.

This allows README.FIRST etc to remain intact, and allows fine control over
what platforms it is applied to.

The downside is that it can't really be spelt on the command-line.  However,
I argue that anyone who needs such fine grained control will have somewhere
more suitable to specify it anyway.

Would that make sense?

Mark.




More information about the Distutils-SIG mailing list