Gentoo Archives: gentoo-dev

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

Replies

Subject Author
Re: [gentoo-dev] [News item review v4] Python preference to follow PYTHON_TARGETS Philip Webb <purslow@××××××××.net>