[Distutils] How to handle launcher script importability?

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Aug 14 17:20:42 CEST 2013





> From: Nick Coghlan <ncoghlan at gmail.com>


> I believe PJE's suggestion is to expand the scope of PEP 441 a bit to
> include the ability to generate a valid Windows executable with the
> archive appended, instead of just the *nix/Python launcher shebang
> line.

I got that; I was commenting on the "embed the entire relevant project" part as applied to wrapped scripts.

> The "script wrapper" case would then just be a particular use of the
> PEP 441 executable generation features:  prepend the console
> executable for console scripts and the GUI executable for GUI
> wrappers, with the wrapper itself being a __main__.py file in the
> attached archive.
> 
> Given that Vinay already gave the Python launcher the ability to do
> this (when built with different options), this sounds quite feasible
> to me.


It's certainly feasible - I'm looking at the implementation now. It's not quite there yet - I need to extract the shebang from the end of the stock executable/beginning of the appended archive to determine the Python to use, and then ensure that the executable is passed to that Python as the script argument.

Regards,

Vinay Sajip


More information about the Distutils-SIG mailing list