<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Sorry, I meant to send this onlist. Reposting:</div><div><br></div>In the end, after some great suggestions and debugging help from Ian Bicking, I managed to monkeypatch the monkeypatch to restore my original script. I was using a hybrid approach (sometimes importing distutils, sometimes setuptools) to avoid the script handling, but with this workaround, I should be able just to switch back to setuptools so that I don't have to think about it.<div><br></div><div>In my case, I have an install_script stub:</div><div><br></div><div><div><font class="Apple-style-span" face="Monaco">def install_script(self, dist, script_name, script_text, dev_path=None):</font></div><div><font class="Apple-style-span" face="Monaco"> self.write_script(script_name, script_text, 'b')</font></div><div><br></div><div>And I then monkeypatch setuptools if it's loaded:</div><div><br></div><div><div><font class="Apple-style-span" face="Monaco">if sys.platform != 'win32' and 'setuptools' in sys.modules:</font></div><div><font class="Apple-style-span" face="Monaco"> # Someone used easy_install to run this. I really want the correct</font></div><div><font class="Apple-style-span" face="Monaco"> # script installed.</font></div><div><font class="Apple-style-span" face="Monaco"> import setuptools.command.easy_install</font></div><div><font class="Apple-style-span" face="Monaco"> setuptools.command.easy_install.easy_install.install_script = install_script</font></div><div><br></div><div>You'll notice that I leave the patching alone on win32, because I understand the desirability of having an exe file there...</div><div><br></div><div>Thanks,</div><div>Douglas Mayle</div></div><div><br><div><div>On Apr 16, 2009, at 2:32 PM, P.J. Eby wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>At 01:03 PM 4/16/2009 -0400, Douglas Mayle wrote:<br><blockquote type="cite">Hey everyone,<br></blockquote><blockquote type="cite"> I'm having an annoying problem and I was directed here to see if you<br></blockquote><blockquote type="cite">knew what could be done.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> I'm using distutils for my package instead of setuptools because it's<br></blockquote><blockquote type="cite">a command line app, and the half second that setup tools adds to each<br></blockquote><blockquote type="cite">launch for pkg_resource scanning is unacceptable. I use the scripts<br></blockquote><blockquote type="cite">parameter, and it happily installs the script I expect and things are<br></blockquote><blockquote type="cite">running along. If I try to use easy_install to install the package,<br></blockquote><blockquote type="cite">however, (and more importantly, if a user of mine does) it seems that<br></blockquote><blockquote type="cite">setuptools is monkeypatching the distutils module and replacing<br></blockquote><blockquote type="cite">setup. This means that instead of just copying my script to bin,<br></blockquote><blockquote type="cite">setuptools is creating it's own script that does a pkg_resource scan<br></blockquote><blockquote type="cite">and then loads my script from the original location. Is there any way<br></blockquote><blockquote type="cite">to ensure that I'm using the distutils.core.setup that I expect, and<br></blockquote><blockquote type="cite">not the one that setuptools monkeypatches into place?<br></blockquote><br>Use "easy_install -eb. MyPackage" to download the source (which will be placed in a 'mypackage/' subdirectory, then change to that directory and run "setup.py install" to install using distutils instead of setuptools.<br><br></div></blockquote></div><br></div></div></body></html>