<div dir="ltr"><div class="gmail_extra">On 15 July 2013 23:21, Vinay Sajip <span dir="ltr"><<a href="mailto:vinay_sajip@yahoo.co.uk" target="_blank">vinay_sajip@yahoo.co.uk</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Paul Moore <p.f.moore <at> <a href="http://gmail.com" target="_blank">gmail.com</a>> writes:<br>

<br>
> I think I'm coming to the conclusion that the best way forward is:<br>
> 1. Continue using the setuptools exe launcher, but bundle our own copy.<br>
<br>
</div>Wouldn't that be the case with a bundled setuptools/pip anyway? The launcher<br>
executables are part of setuptools AFAIK.<br>
<div class="im"><br>
> 2. Modify setup.py to install our own scripts run via the exe launcher,<br>
which don't rely on entry points and pkg_resources.<br>
<br>
</div>FYI the distlib executable launchers (not based on setuptools, but work the<br>
same way) and the distlib script generation approach does not require<br>
distlib to run. You might be able to make use of that in some way :-)</blockquote></div><br>Yes, the physical executables aren't that much of an issue - grabbing them from somewhere and bundling them is easy enough and as you say we may already have them (I actually thought distlib included the exes, but the version bundled with pip at the moment doesn't have them).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The fun bit is having to modify setuptools to do our own script wrapper management, because setuptools doesn't let us customise its process to remove the runtime dependency on a top-level pkg_resources. Having to make project-specific customisations to distutils feels like we're going in precisely the opposite direction from what the whole packaging process is trying to achieve, and it makes me feel vaguely unclean having to consider it :-)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Two thoughts for the wider audience:</div><div class="gmail_extra"><br></div><div class="gmail_extra">1. Should pip re-vendor a newer version of distlib, so we have the exe wrappers? We currently have 0.1.1 and 0.1.2 is on PyPI.</div>
<div class="gmail_extra">2. Would writing a distutils extension class in setup.py to make the exe wrappers using the vendored distlib.scripts package be acceptable to remove the runtime dependency on pkg_resources from the wrappers?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Note: This is just one relatively small step towards removing some of our dependencies on an external setuptools. It's not the whole story, and it still leaves the "upgrading a running exe wrapper" problem to address.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">(This discussion may be worth migrating to pypa-dev, I'm not sure how much the wider distutils audience cares about this level of detail - feel free to switch lists anyone who thinks it's appropriate).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Paul</div></div>