I just stumbled over the following problem, maybe someone can help me understand whether its a problem that should be fixed in setuptools or whether I'm misunderstanding something. I was packaging an application (a TurboGears quickstarted project) that has one a pure Python start script with bdist_egg. I'm using /usr/bin/env for finding the Python interpreter in the shebang line of the start script in order to make the whole thing as platform independent as possible. Now bdist_egg replaces my shebang line with the path to the python interpreter of the build platform. I just saw that this was already mentioned as a problem on the list recently: http://mail.python.org/pipermail/distutils-sig/2007-February/007306.html I agree that this should be changed as suggested there. Currently, even though an application may be completely platform independent, setuptools creates "impure" eggs by putting a platform dependent path into the scripts. I.e. I cannot package the application on one platform and easy_installing it on a different platform. I think the real problem is that setuptools replaces the shebang line when *building* the egg, not when *installing* the egg. Maybe the replacement at build time is done for backward compatibility with distutils? But then it should be done when easy_installing as well. -- Chris
At 12:14 PM 5/5/2007 +0200, Christoph Zwerschke wrote:
I just stumbled over the following problem, maybe someone can help me understand whether its a problem that should be fixed in setuptools or whether I'm misunderstanding something.
I was packaging an application (a TurboGears quickstarted project) that has one a pure Python start script with bdist_egg. I'm using /usr/bin/env for finding the Python interpreter in the shebang line of the start script in order to make the whole thing as platform independent as possible.
Now bdist_egg replaces my shebang line with the path to the python interpreter of the build platform. I just saw that this was already mentioned as a problem on the list recently: http://mail.python.org/pipermail/distutils-sig/2007-February/007306.html I agree that this should be changed as suggested there.
Currently, even though an application may be completely platform independent, setuptools creates "impure" eggs by putting a platform dependent path into the scripts. I.e. I cannot package the application on one platform and easy_installing it on a different platform.
I think the real problem is that setuptools replaces the shebang line when *building* the egg, not when *installing* the egg.
Use entry point scripts instead; they don't have this problem: http://peak.telecommunity.com/DevCenter/setuptools#automatic-script-creation
Phillip J. Eby wrote:
Christoph Zwerschke wrote:
... I think the real problem is that setuptools replaces the shebang line when *building* the egg, not when *installing* the egg.
Use entry point scripts instead; they don't have this problem:
http://peak.telecommunity.com/DevCenter/setuptools#automatic-script-creation Ok, and they have some other advantages as well, so I just suggested to change this in TurboGears (http://trac.turbogears.org/ticket/1386). Anyway, I think this is a flaw in distutils that should be fixed if it's not too difficult. -- Chris
participants (2)
-
Christoph Zwerschke
-
Phillip J. Eby