Gentoo Archives: gentoo-user

From: Mike Gilbert <floppym@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] did python-r1 improve user experience?
Date: Sun, 27 Oct 2013 02:48:20
Message-Id: CAJ0EP42OF_bHoaSPVzBWysxW6Mp3Wp=FQAOXe7fiSrNAGSk8bQ@mail.gmail.com
In Reply to: Re: [gentoo-user] did python-r1 improve user experience? by Walter Dnes
1 On Sat, Oct 26, 2013 at 10:18 PM, Walter Dnes <waltdnes@××××××××.org> wrote:
2 > On Sat, Oct 26, 2013 at 09:30:57PM -0400, Mike Gilbert wrote
3 >
4 >> The (non-)relationship between eselect python and PYTHON_TARGETS is
5 >> something that would be nice to resolve, but I don't know how to do
6 >> it. PYTHON_SINGLE_TARGET will probably cause problems if/when packages
7 >> start supporting python3 only.
8 >
9 > What I find interesting/annoying is that my make.conf has to have 3
10 > lines...
11 >
12 > PYTHON_SINGLE_TARGET="python2_7"
13 > PYTHON_TARGETS="python2_7"
14 > USE_PYTHON="2.7"
15 >
16 > ...as if it didn't hear me the first time. How difficult would it be to
17 > set up an eclass to tell portage that...
18 >
19 > if PYTHON_SINGLE_TARGET="pythonX_Y"
20 >
21 > PYTHON_TARGETS defaults to "${PYTHON_SINGLE_TARGET}"
22 >
23 > USE_PYTHON defaults to "${PYTHON_SINGLE_TARGET/_/.}"
24 >
25 > Over-ride the default if explicitly listed. Out of sheer curiousity,
26 > what circumstances are there where ordinary users would need differing
27 > values for these 3 items?
28 >
29
30 PYTHON_TARGETS and PYTHON_SINGLE_TARGET are used indirectly by
31 python-r1.eclass. However, both are both expanded into use flags and
32 used in dependency calculations before any ebuild/eclass code is
33 invoked. So, we cannot manipulate them in an eclass or ebuild.
34
35 PYTHON_TARGETS may contain multiple python versions and is used for
36 most python packages in the tree. It allows the same package to be
37 installed for multiple python versions simultaneously.
38
39 PYTHON_SINGLE_TARGET should only contain one python version; it is
40 used for packages which cannot (easily) be made to support multiple
41 versions of python simultaneously. So we have to pick one.
42
43 USE_PYTHON is a legacy setting used by the old python.eclass and is
44 not used to control any use flags or dependencies. Ideally, we could
45 default this to PYTHON_TARGETS, but due to the way use-expanded
46 variables work this is not possible. This variable will go away once
47 python.eclass is removed from the portage tree.