[Distutils] bdist_eggs soiling pure packages

Christoph Zwerschke cito at online.de
Sat May 5 12:14:37 CEST 2007


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


More information about the Distutils-SIG mailing list