Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [News item review] Python preference to follow PYTHON_TARGETS
Date: Sun, 24 Jan 2021 12:21:34
Message-Id: 2c4f440d9d368fd8b1aaed94e3cc992bfb987e8c.camel@gentoo.org
1 Hi,
2
3 Please review the news item inlined below.
4
5 I'd like to publish it ASAP and stabilize python-exec-conf on 2021-02-
6 01.
7
8 ```
9 Title: Python preference to follow PYTHON_TARGETS
10 Author: Michał Górny <mgorny@g.o>
11 Posted: 2021-01-24
12 Revision: 1
13 News-Item-Format: 2.0
14
15 On 2021-02-01 stable users will switch to a new method of updating
16 the preferred Python versions that employs the configuration update
17 mechanism in order to follow PYTHON_TARGETS. We will also deprecate
18 and stop installing app-eselect/eselect-python by default.
19
20 Since 2017, /usr/bin/python and the related non-versioned symlinks
21 are wrapped through dev-lang/python-exec. The list of preferred Python
22 implementations is stored in /etc/python-exec/python-exec.conf and/or
23 per-program /etc/python-exec/<basename>.conf configuration files.
24 To preserve backwards compatibility, app-eselect/eselect-python remained
25 a wrapper that updated this file.
26
27 However, this mechanism alone has proven inconvenient to end users who
28 had to update python-exec.conf whenever the default PYTHON_TARGETS
29 changed. Thanks to the fallback logic, this was not a major problem
30 for software installed via Gentoo packages that always ensure that
31 a supported implementation is used. However, users have reported that
32 whenever the preference for /usr/bin/python mismatched their
33 PYTHON_TARGETS, their custom scripts would break due to unsatisfied
34 dependencies. This does not follow the principle of least surprise.
35
36 For this reason, we have decided to change the default python-exec
37 configuration to match PYTHON_TARGETS by default, in the eclass
38 preference order, that is from the newest CPython version to oldest,
39 with alternative Python implementations coming afterwards. This change
40 will be propagated via the configuration protection mechanism whenever
41 dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
42 changes. This will permit the users to interactively confirm
43 the updates.
44
45 If the new default is not correct for you, please use your preferred
46 configuration update tool to discard or edit the new configuration file.
47
48 Furthermore, dev-lang/python will no longer attempt to automatically
49 update the Python interpreter preference, or pull in eselect-python
50 automatically. If you wish to continue using it, please install it
51 manually to ensure that it is not unmerged.
52 ```
53
54
55 --
56 Best regards,
57 Michał Górny

Replies