Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o
Subject: [gentoo-python] [eselect-python] Patches to switch to full python-exec wrapping
Date: Sun, 15 Nov 2015 09:39:25
Message-Id: 1447580355-16777-1-git-send-email-mgorny@gentoo.org
1 Hi,
2
3 A quick patch set I've created a few days ago and enabled
4 on python-wrapper-full-replacement branch (on my github fork of gentoo).
5
6 Currently the wrapping of Python executables is a mess. The python
7 executable is wrapped using python-wrapper. python-config has a custom
8 generated wrapper, and python[23] are just symlinks (so no wrapping),
9 similarly to a few remaining Python executables.
10
11 My idea is to use python-exec for everything. Long story short, I
12 modified all newest revisions (in the branch) to install appropriate
13 symlinks in /usr/lib/python-exec/... so that python-exec can recognize
14 all Python executables appropriately. I've taken all the executables
15 that make sense for new Python versions -- python, pythonN,
16 python-config, pythonN-config, pydoc, 2to3, pyvenv.
17
18 Now that python-exec is aware of the stuff, I just modified
19 eselect-python to stop playing with the stuff and just handle
20 configuration and symlinks for non-executable stuff (manpages,
21 frameworks like we ever cared about those). Instead, the ebuild installs
22 a few appropriate symlinks to python-exec (that replace those created by
23 eselect-python in the past).
24
25 In other words, if you spawn 'python3', then python-exec simply looks
26 through /usr/lib/python-exec/*/python3 to select the most preferred
27 version. Since only dev-lang/python-3.* install 'python3' symlinks
28 there, only those are considered. All the magic works and everyone is
29 happy.
30
31 As you can see, the ebuild changes (not included there) are kinda more
32 important yet the patchset accompanies them well. It specifically:
33
34 1. adds .lz manpage support. Not that the whole hardcoded compressor
35 list makes sense but it at least silences the error for me.
36
37 2. Moves python[23] selections to a file. Currently, they are 'stored'
38 in the symlink which is non-portable and collides with the new wrapper.
39
40 3. Kills the code that created all executable symlinks.
41
42 4. Kills python-wrapper since it is no longer used.
43
44 Stay tuned for ebuild patches.
45
46 --
47 Best regards,
48 Michał Górny

Replies