Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o
Subject: [gentoo-python] 'Converted' Python script suffixes vs EPYTHON
Date: Fri, 05 Oct 2012 20:05:03
Message-Id: 20121005220516.2d882895@pomiocik.lan
1 Hello,
2
3 As you may know, distutils-r1 (much like python.eclass & p-d-ng)
4 holds separate ('converted') copies of Python scripts for each
5 implementation. And much like python.eclass, it will use a wrapper
6 program to choose the 'default' script version respecting
7 eselect-python.
8
9 So, if dev-python/foo installs /usr/bin/foo, the following will be
10 installed:
11
12 - /usr/bin/foo-pypy1_8
13 - /usr/bin/foo-python2_6
14 - /usr/bin/foo-python2_7
15 - /usr/bin/foo-jython2_5
16 ^^^^^^^^^
17 - /usr/bin/foo -> py-exec
18
19 I have allowed myself to highlight the implementation suffixes in
20 scripts. These are suffixes used by p-d-ng, and they are the same as
21 implementation names used in PYTHON_TARGETS.
22
23 python.eclass used instead:
24 - /usr/bin/foo-2.7-pypy-1.8 (yes, seriously)
25 - /usr/bin/foo-2.6
26 - /usr/bin/foo-2.7
27 - /usr/bin/foo-2.5-jython
28
29 which are completely custom. Now, Gentoo's EPYTHON variable instead
30 contains Python executable names which are (for those suffixes):
31 - pypy-c1.8
32 - python2.6
33 - python2.7
34 - jython2.5
35
36 Now, I'm wondering what to do in order for the wrapper (py-exec)
37 to be optimal and compliant with Gentoo's EPYTHON (and thus
38 eselect-python).
39
40
41 1/ Use current python-distutils-ng names.
42
43 Adv:
44 - same values as in PYTHON_TARGETS,
45 - converting the ~25 ebuilds wouldn't change names.
46 Disadv:
47 - starting every python app through 'foo' would require converting
48 the EPYTHON value to PYTHON_TARGETS,
49 - python wrapper would have to have conversion tables hardcoded (and I
50 really dislike doing this).
51
52
53 2/ Change suffixes to match $EPYTHON.
54
55 Adv:
56 - makes the wrapper really simple,
57 - more 'compliance' with python.eclass.
58 Disadv:
59 - the EPYTHON name for pypy is 'pypy-c', so it'd be 'foo-pypy-c1.8'.
60
61
62 Any other ideas? Thoughts?
63
64 You can take a look at current wrapper code (it's called
65 python-wrapper-r1, I will rename it later)[1] but note that's
66 a partial solution and the actual one will be either more complex
67 (if 1/) or simpler (if 2/).
68
69 [1]:https://bitbucket.org/mgorny/python-wrapper-r1/src/master/src/python-wrapper.c
70
71 --
72 Best regards,
73 Michał Górny

Attachments

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

Replies