[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: python shebang, and other interpreters.



[Wolodja Wentland, 2009-09-20]
> On Sun, Sep 20, 2009 at 20:52 +0200, Piotr Ożarowski wrote:
>>[Wolodja Wentland, 2009-09-20]
>>> To give a somewhat extreme example. A user could decide to install a new
>>> Python version within /usr/local - which i think is commonly done with
>>> Python 2.6 these days - and could link /usr/bin/python to
>>> /usr/local/bin/python2.6
    ^^^^^^^^^^^^^^^^^^^^^^^^          ^^^^^^^^^^^^^^^^^^^^^^^
>>> . Which would - of course - be stupid but the
>>> administrator has the freedom to do so and has to live with the
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> consequences, ie errors in the execution of programs installed with
>>> apt*.
> > If user/administrator is not following FHS and touching files outside
> > /usr/local, it's his problem. /usr/local and /etc is where administrator
> > can do his changes/improvements.
> 
> I completely agree! Did I give you reason to believe that I actually
> propose such insane actions?

See above. Sane administrator will never change /usr/bin/python symlink.
(too many tools depend on it)

[...]
> Which is why I try to avoid setuptools

setuptools it not bad per se, it's just how people use it

> as hard as I can and use plain distutils to package my software and
> urge users to install them to PREFIX /usr/local or use
> --install-layout=deb.

--install-layout=deb should be used by package maintainers only, if
you're encouraging users to install files in /usr and not /usr/local
(--install-layout=deb is just a shortcut for --prefix=/usr and
--install-lib=/usr/lib/pythonX.Y/dist-packages) you're doing exactly the
same what "sudo easy_install"-people do (it doesn't matter that these
modules were not installed via Eggs)

--install-layout=deb was introduced due to another (*very desired*)
change: Python >= 2.6 now installs to /usr/local by default (finally!)

[...]
> I don't see how this is related to the intention of my original post
> which was the *suggestion* for a policy change to require *either*
                                                            ^^^^^^^^
> '/usr/bin/python' or '/usr/bin/env python' so that Python programs
> installed with apt* show consistent behaviour.

See my initial reply (/usr/bin/python* by default, with exceptions).

There's no "either". No permanent changes system wide, never! Some
applications can be used in local env.[0] and some cannot. These that
can be used in such env. should have '/usr/bin/env python' in shebang,
these that cannot - '/usr/bin/python*'.

[0] by local env. I mean something like python-virtualenv, not changing
    `env python` output system wide or replacing /usr/bin/python
    symlink. No one except python package maintainer can change
    /usr/bin/python*

> And to reiterate another point: If I as a user change my Python
> environment is it unreasonable to assume that all Python software will
> run in that environment?

you can try to run in this new env. whatever application you want, even
packaged one with shebang set to /usr/bin/python* (see one of my
previous mails to see how), most of them will fail, though.
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

Attachment: signature.asc
Description: Digital signature


Reply to: