Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python <gentoo-python@l.g.o>
Subject: Re: [gentoo-python] RFC: Redesign for 'best implementation' in python-r1
Date: Fri, 02 Jan 2015 23:37:19
Message-Id: 20150103003708.63582b3f@pomiot.lan
In Reply to: [gentoo-python] RFC: Redesign for 'best implementation' in python-r1 by "Michał Górny"
1 Dnia 2014-12-27, o godz. 14:50:43
2 Michał Górny <mgorny@g.o> napisał(a):
3
4 > 3. we introduce extra variable for distutils-r1 (oh cruel world, how
5 > should we name it?!) that applies wildcards to python_*_all() phases.
6
7 Ok, I see a problem with this one. Consider the common use:
8
9 DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )"
10 REQUIRED_USE="doc? ( $(python_gen_useflags 'python2*') )"
11
12 python_compile_all() {
13 use doc && esetup.py doc # runs epydoc
14 }
15
16 So we'd like the _all() phase to be run with python2* because of epydoc.
17 But OTOH we don't need any python2* if USE=-doc.
18
19 If we used a simple variable to control impl for _all(), it would
20 unnecessarily force python2* with USE=-doc, and python2* may not be
21 enabled at all then. So we either set it conditionally (+ extra phase,
22 added complexity), or make it non-fatal. Non-fatal is ugly since it
23 means unpredictable behavior.
24
25 So we can use a complex variable instead. But this way, we're in
26 python.eclass territory soon. Alternatively, add some function that's
27 called random-early by other python stuff, and that can be used to set
28 this variable -- but this doesn't look like good API design.
29
30 Maybe calling python_setup inside _all() phases -- but this implies
31 setting at least two environments, and we'd have to handle extra stuff
32 that distutils-r1 sets like PYTHONPATH. Still doesn't sound good.
33
34 So any ideas? :P
35
36 --
37 Best regards,
38 Michał Górny