Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: Ben de Groot <yngwin@g.o>
Cc: gentoo-python@l.g.o, Gentoo Python Project <python@g.o>
Subject: Re: [gentoo-python] 'Converted' Python script suffixes vs EPYTHON
Date: Sat, 06 Oct 2012 08:13:47
Message-Id: 20121006101356.36f28526@pomiocik.lan
In Reply to: Re: [gentoo-python] 'Converted' Python script suffixes vs EPYTHON by Ben de Groot
1 On Sat, 6 Oct 2012 11:26:35 +0800
2 Ben de Groot <yngwin@g.o> wrote:
3
4 > On 6 October 2012 04:05, Michał Górny <mgorny@g.o> wrote:
5 > > Hello,
6 > >
7 > > As you may know, distutils-r1 (much like python.eclass & p-d-ng)
8 > > holds separate ('converted') copies of Python scripts for each
9 > > implementation. And much like python.eclass, it will use a wrapper
10 > > program to choose the 'default' script version respecting
11 > > eselect-python.
12 > >
13 > > So, if dev-python/foo installs /usr/bin/foo, the following will be
14 > > installed:
15 > >
16 > > - /usr/bin/foo-pypy1_8
17 > > - /usr/bin/foo-python2_6
18 > > - /usr/bin/foo-python2_7
19 > > - /usr/bin/foo-jython2_5
20 > > ^^^^^^^^^
21 > > - /usr/bin/foo -> py-exec
22 > >
23 > > I have allowed myself to highlight the implementation suffixes in
24 > > scripts. These are suffixes used by p-d-ng, and they are the same as
25 > > implementation names used in PYTHON_TARGETS.
26 > >
27 > > python.eclass used instead:
28 > > - /usr/bin/foo-2.7-pypy-1.8 (yes, seriously)
29 > > - /usr/bin/foo-2.6
30 > > - /usr/bin/foo-2.7
31 > > - /usr/bin/foo-2.5-jython
32 > >
33 > > which are completely custom. Now, Gentoo's EPYTHON variable instead
34 > > contains Python executable names which are (for those suffixes):
35 > > - pypy-c1.8
36 > > - python2.6
37 > > - python2.7
38 > > - jython2.5
39 > >
40 > > Now, I'm wondering what to do in order for the wrapper (py-exec)
41 > > to be optimal and compliant with Gentoo's EPYTHON (and thus
42 > > eselect-python).
43 > >
44 > >
45 > > 1/ Use current python-distutils-ng names.
46 > >
47 > > Adv:
48 > > - same values as in PYTHON_TARGETS,
49 > > - converting the ~25 ebuilds wouldn't change names.
50 > > Disadv:
51 > > - starting every python app through 'foo' would require converting
52 > > the EPYTHON value to PYTHON_TARGETS,
53 > > - python wrapper would have to have conversion tables hardcoded (and I
54 > > really dislike doing this).
55 > >
56 > >
57 > > 2/ Change suffixes to match $EPYTHON.
58 > >
59 > > Adv:
60 > > - makes the wrapper really simple,
61 > > - more 'compliance' with python.eclass.
62 > > Disadv:
63 > > - the EPYTHON name for pypy is 'pypy-c', so it'd be 'foo-pypy-c1.8'.
64 > >
65 > >
66 > > Any other ideas? Thoughts?
67 > >
68 > > You can take a look at current wrapper code (it's called
69 > > python-wrapper-r1, I will rename it later)[1] but note that's
70 > > a partial solution and the actual one will be either more complex
71 > > (if 1/) or simpler (if 2/).
72 > >
73 > > [1]:https://bitbucket.org/mgorny/python-wrapper-r1/src/master/src/python-wrapper.c
74 > >
75 > > --
76 > > Best regards,
77 > > Michał Górny
78 >
79 > I vote for simple = 2.
80
81 https://bitbucket.org/mgorny/gx86-working-tree/src/python-r1-w-epython-suffixes
82 http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=shortlog;h=refs/heads/python-r1-migration
83 https://bitbucket.org/mgorny/python-exec/src/epython-suffixes
84
85 On these branches, 2/ is implemented. Well, you probably gotta stack it
86 all together by hand right now but it should be enough to review it :P.
87
88 --
89 Best regards,
90 Michał Górny

Attachments

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