Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o
Subject: [gentoo-python] RFC: naming of EPYTHON-variants of scripts
Date: Mon, 26 Aug 2013 08:16:44
Message-Id: 20130826101649.74a09af8@gentoo.org
Hello, all.

Currently we've inherited the script naming scheme used by
python.eclass, then modified by python-distutils-ng and then modified
again by us. However, this has a few disadvantages.

The scripts are named like:

    /usr/bin/foo-pythonX.Y

and a wrapper is installed in /usr/bin/foo.

Advantages:

- easy access to every variant (in $PATH).

Disadvantages:

- tab completion polluted with all those variants,

- argv[0] changed which makes some software unhappy.


As a quick idea, here's an alternative:

    /usr/lib/python-scripts/pythonX.Y/foo

(or something similar, path needs to be discussed)

Advantages:

- wrapper could be mostly 'replaced' by placing those dirs in $PATH,
  in specific order,

- we can let user decide on *exact* order of implementation preference
  without making code complex,

- basename(argv[0]) is preserved.

Disadvantages:

- handling locations outside standard $PATH locations could result in
  'deep' directory structure (do we have any?),

- potential $PATH pollution (6-8 paths in the 'worst' case). Do modern
  systems have any trouble with that?

- harder to choose a specific implementation. 'foo-python2.7' nor
  'EPYTHON=python2.7' would work anymore. You'd need to pass the full
  path,

- we will probably still need the wrapper in /usr/bin because of
  software that doesn't do $PATH lookups.


I feel like the second idea is the way forward. Though for implementing
it we will probably need to either kill off python.eclass for good, or
patch it to support the new way. Supporting it in python-r1 is pretty
straightforward.

-- 
Best regards,
Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature