Gentoo Archives: gentoo-dev

From: Alexey Sokolov <alexey+gentoo@××××××××.org>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [News item review v2] Python preference to follow PYTHON_TARGETS
Date: Sun, 24 Jan 2021 18:16:39
Message-Id: CAHK_jdhygxfE=8TU_5YzfqtbyYzMssDYR3gVdQ5F9v4svMSNAQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] [News item review v2] Python preference to follow PYTHON_TARGETS by "Michał Górny"
1 вс, 24 янв. 2021 г. в 12:59, Michał Górny <mgorny@g.o>:
2 >
3 > Here's v2 with extra 'tl;dr' instructions in first para:
4 >
5 > ```
6 > Title: Python preference to follow PYTHON_TARGETS
7 > Author: Michał Górny <mgorny@g.o>
8 > Posted: 2021-01-24
9 > Revision: 1
10 > News-Item-Format: 2.0
11 >
12 > On 2021-02-01 stable users will switch to a new method of updating
13 > the preferred Python versions that employs the configuration update
14 > mechanism in order to follow PYTHON_TARGETS. We will also deprecate
15 > and stop installing app-eselect/eselect-python by default. If you wish
16 > to use the newest Python version present in your PYTHON_TARGETS, you
17 > only have to accept configuration changes. If you wish need
18 > to customize the behavior, read on.
19
20 typo: wish need
21
22 >
23 > Since 2017, /usr/bin/python and the related non-versioned symlinks
24 > are wrapped through dev-lang/python-exec. The list of preferred Python
25 > implementations is stored in /etc/python-exec/python-exec.conf and/or
26 > per-program /etc/python-exec/<basename>.conf configuration files.
27 > To preserve backwards compatibility, app-eselect/eselect-python remained
28 > a wrapper that updated this file.
29 >
30 > However, this mechanism alone has proven inconvenient to end users who
31 > had to update python-exec.conf whenever the default PYTHON_TARGETS
32 > changed. Thanks to the fallback logic, this was not a major problem
33 > for software installed via Gentoo packages that always ensure that
34 > a supported implementation is used. However, users have reported that
35 > whenever the preference for /usr/bin/python mismatched their
36 > PYTHON_TARGETS, their custom scripts would break due to unsatisfied
37 > dependencies. This does not follow the principle of least surprise.
38 >
39 > For this reason, we have decided to change the default python-exec
40 > configuration to match PYTHON_TARGETS by default, in the eclass
41 > preference order, that is from the newest CPython version to oldest,
42 > with alternative Python implementations coming afterwards. This change
43 > will be propagated via the configuration protection mechanism whenever
44 > dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
45 > changes. This will permit the users to interactively confirm
46 > the updates.
47 >
48 > If the new default is not correct for you, please use your preferred
49 > configuration update tool to discard or edit the new configuration file.
50 >
51 > Furthermore, dev-lang/python will no longer attempt to automatically
52 > update the Python interpreter preference, or pull in eselect-python
53 > automatically. If you wish to continue using it, please install it
54 > manually to ensure that it is not unmerged.
55
56 Perhaps add the "emerge" command here, to avoid users to actually
57 *manually* installing it? That is, not via the ebuild.
58
59 The Russian translation follows. Should I post it as a separate file somewhere?
60
61 Title: Предпочтения Python будут следовать PYTHON_TARGETS
62
63 1 февраля 2021 пользователи стабильной ветки перейдут на новый метод обновления
64 предпочтительной версии Python, который будет использовать значение переменной
65 PYTHON_TARGETS и применять механизм обновления конфигураций. Также мы
66 объявляем app-eselect/eselect-python устаревшим и по умолчанию перестанем его
67 устанавливать. Если вы хотите использовать самую новую версию Python из
68 указанных в PYTHON_TARGETS, вам надо только принять изменения конфигурации.
69 Если же вам нужно настроить индивидуальное поведение, продолжайте читать.
70
71 С 2017 года /usr/bin/python и тому подобные символические ссылки без версии
72 являются обёртками с помощью dev-lang/python-exec. Список предпочтительных
73 реализаций Python хранится в /etc/python-exec/python-exec.conf и/или в
74 /etc/python-exec/<программа>.conf для программ с конфигурацией не по умолчанию.
75 Для обратной совместимости app-eselect/eselect-python остался обёрткой, которая
76 обновляла этот файл.
77
78 Однако сам по себе этот механизм оказался неудобен пользователям, которым
79 теперь приходилось обновлять python-exec.conf каждый раз, когда менялась
80 переменная PYTHON_TARGETS. Благодаря логике запасных вариантов это не было
81 большой проблемой для программ, установленных из репозитория Gentoo, т.к. они
82 гарантируют использование поддерживаемой реализации Python. Но пользователи
83 сообщали, что, когда предпочтение для /usr/bin/python не совпадало с их
84 PYTHON_TARGETS, из-за неудовлетворённых зависимостей ломались пользовательские
85 программы, что противоречит принципу наименьшего удивления.
86
87 Поэтому мы решили изменить стандартную настройку python-exec, теперь она будет
88 совпадать с PYTHON_TARGETS в порядке предпочтения, используемым eclass'ом:
89 сначала все CPython, начиная с новейшей версии и заканчивая старейшей, затем
90 другие реализации Python. Это изменение будет установлено в систему с помощью
91 механизма защиты конфигураций каждый раз при установке или пересборке
92 dev-lang/python-exec-conf из-за изменения PYTHON_TARGETS. При этом у
93 пользователей будет возможность интерактивно подтвердить данные изменения.
94
95 Если новые настройки вам не подходят, пожалуйста, используйте ваш любимый
96 инструмент обновления конфигурации, чтобы отбросить изменения или
97 отредактировать новый файл.
98
99 Более того, dev-lang/python больше не будет пытаться автоматически обновить
100 предпочтительную версию Python и больше не будет автоматически затягивать
101 eselect-python. Если вы хотите продолжать его использовать, пожалуйста,
102 установите его вручную, чтобы он не удалился.

Replies