Gentoo Archives: gentoo-dev

From: Alexandre Rostovtsev <tetromino@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass for Python
Date: Wed, 29 Feb 2012 19:52:09
Message-Id: 1330545088.15103.62.camel@rook
In Reply to: [gentoo-dev] New eclass for Python by Krzysztof Pawlik
1 On Tue, 2012-02-28 at 22:13 +0100, Krzysztof Pawlik wrote:
2 > Hello,
3 >
4 > After some work during weekend on Python packages I've decided to start a
5 > rewrite of Python/distutils eclass for installing Python packages. My main goal
6 > was simplicity and functionality similar to ruby-ng.eclass (thanks Ruby team for
7 > your great work!). Python team members already contributed comments and
8 > suggestions and helped me to make the eclass better, thank you!
9 >
10 > Highlights:
11 > - *SIMPLE*next
12 > - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
13 > - EAPI4 required, uses REQUIRED_USE
14 > - <400 lines of code including documentation
15 > - should work for >95% of packages (my educated guess)
16 > - did I mention it's *SIMPLE*?
17 > - easy to maintain & read so it's also easy to use
18 >
19 > Important thing: I'm not aiming at having 100% functionality of current
20 > python.eclass+distutils.eclass in the new one, I think that simplicity is more
21 > important that supporting every possible, obscure case that's out there.
22 >
23 > I'm attaching the eclass itself and two ebuilds using it, code is also available
24 > in my overlay at;a=summary
25 >
26 > If there are no objections then during the weekend (March 3, 4) I will add this
27 > to portage (after finishing remaining TODO items, PyPy requires 4G of RAM(!!)).
29 The proposed eclass omits three features from python.eclass which are
30 heavily used in the gnome stack.
32 First, it does not set EPYTHON, which is a problem for the many packages
33 whose build systems execute /usr/bin/python and assume that it's a
34 generic python2 or the same version of python2.x for which the package
35 is being built.
37 Second, there doesn't seem to be any support for packages that do not
38 install in python's site-packages and do not allow multiple python ABIs.
39 If I have, for example, a package that installs python modules
40 in /usr/lib/appname or /usr/share/appname, how can I specify that
41 PYTHON_TARGETS="python2.6" or "python2.7" or "python3.2" is allowed, but
42 something like PYTHON_TARGETS="python2.7 python3.2" is not?
44 Third, python-distutils-ng_doscript() installs only one file at a time
45 (no built-in support for multiple files at a time or for recursing
46 through a directory tree), installs it only in /usr/bin (a package might
47 want it in e.g. /usr/libexec or /usr/share/appname/scripts), and always
48 creates scriptname-IMPLEMENTATION (polluting tab-completion in /usr/bin
49 for the common case of programs that do not support multiple python
50 ABIs). As a result, it is far less useful than python.eclass's
51 python_convert_shebangs().
53 -Alexandre.


Subject Author
Re: [gentoo-dev] New eclass for Python Krzysztof Pawlik <nelchael@g.o>