Gentoo Archives: gentoo-dev

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