[Distutils] shebang line modified by setuptools

Jan Matejek jan.matejek at novell.com
Mon Apr 14 20:59:32 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry Warsaw napsal(a):
| On Apr 13, 2008, at 8:04 AM, Gael Varoquaux wrote:
|> On Sun, Apr 13, 2008 at 07:59:21AM -0400, Barry Warsaw wrote:
|>> On Apr 12, 2008, at 9:41 PM, Stephen Waterbury wrote:
|>>> I used to always set up my own Python[s] in /usr/local
|>>> and put that first in my PATH, but I have gotten lazy lately, and
|>>> sometimes it will bite me. ;)
|>> On Debian and derivatives (e.g. Ubuntu) you might have even more fun.
|>> They put /usr/local/lib/pythonX.Y/site-packages on the sys.path *of
|>> the system python*!  This means that you can break your system Python
|>> by installing a version of Python from source and then distutil'ing
|>> things into there.  Astoundingly, this is promoted as a feature.
|> I want it like that. You are confusing /opt and /usr/local.
|
|> This is the way I expect things to work. I do not want to install my
|> own
|> packages in "/usr/lib/pythonX.Y/site-packages". This is for apt to
|> deal
|> with, not for me.
|
| Actually, the solution that I believe is a good compromise is to find
| some other path in /usr/local to augment the system Python's sys.path
| with.  All I'm saying is that Python itself uses /usr/local/lib/
| pythonX.Y/site-packages as the default from-source path, so if Debian
| wants a /usr/local path, it can pick some other subdirectory path and
| still meet its goals.  BTW, I believe Debian is unique here.  I talked
| to the Fedora guys and I've talked to a few Gentoo guys and both
| seemed surprised by Debian's policy here.

Actually, openSUSE does this too, and i've even gone as far as making
distutils install into /usr/local by default. Several reasons to do this:
a) FHS says, "user installed apps go into /usr/local, period"
b) the user should have a clean site-packages directory for his needs
c) we don't want the user to mess with package-managed modules in /usr

and finally, the reason i'm not very happy to "pick some other
subdirectory path":
d) it is simple to tell distutils that default prefix is /usr/local. It
is complicated and ugly to tell it that by default it should go to
/usr/local/some-directory-of-my-own, and still be able to revert to
system-ish installation by supplying --prefix=/usr (following the same
semantics that autoconf/automake is using).
Of course we could introduce SUSE-specific --install-like-system-does
switch, but if the user wants, for whatever reason, to install to a
system-ish location, he would need to find out about this. And
furthermore, it would make cross-distro packaging even harder (openSUSE
Buildservice anyone?)

Plus, /usr/local/lib/pythonX.Y/site-packages still looks like a
reasonably standard path, whereas
/usr/local/weird-place/nobody-ever-heard-of is just your garden variety
nonsensical and unsupported distro-specific customization.

I never realized that this would be a bad thing to do, and i still dot
think so - /usr/local is at the end of sys.path anyway, so user can
override system-installed packages and break his python only if he
specifically tries to do that.

I will be happy to abandon this practice as soon as there is some kind
of official policy that solves all the mentioned points.

(Of course, things would be much simpler if python, in perl's fashion,
by default supported site-packages and vendor-packages directories
specifically for this purpose - still violating FHS, but in a way nobody
really cares about anymore. Nudge nudge, wink wink ;) )

regards
jan matejek

|
| -Barry
|
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG at python.org
http://mail.python.org/mailman/listinfo/distutils-sig


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIA6mUjBrWA+AvBr8RAsK6AJ9lo7foixt2/LmV2RDb3TCM6e46igCeKB4f
R2mWEX8hQ4qG2UaeescJS24=
=u88R
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list