Mailing List Archive

[News item review] Python preference to follow PYTHON_TARGETS
Hi,

Please review the news item inlined below.

I'd like to publish it ASAP and stabilize python-exec-conf on 2021-02-
01.

```
Title: Python preference to follow PYTHON_TARGETS
Author: Micha? Górny <mgorny@gentoo.org>
Posted: 2021-01-24
Revision: 1
News-Item-Format: 2.0

On 2021-02-01 stable users will switch to a new method of updating
the preferred Python versions that employs the configuration update
mechanism in order to follow PYTHON_TARGETS. We will also deprecate
and stop installing app-eselect/eselect-python by default.

Since 2017, /usr/bin/python and the related non-versioned symlinks
are wrapped through dev-lang/python-exec. The list of preferred Python
implementations is stored in /etc/python-exec/python-exec.conf and/or
per-program /etc/python-exec/<basename>.conf configuration files.
To preserve backwards compatibility, app-eselect/eselect-python remained
a wrapper that updated this file.

However, this mechanism alone has proven inconvenient to end users who
had to update python-exec.conf whenever the default PYTHON_TARGETS
changed. Thanks to the fallback logic, this was not a major problem
for software installed via Gentoo packages that always ensure that
a supported implementation is used. However, users have reported that
whenever the preference for /usr/bin/python mismatched their
PYTHON_TARGETS, their custom scripts would break due to unsatisfied
dependencies. This does not follow the principle of least surprise.

For this reason, we have decided to change the default python-exec
configuration to match PYTHON_TARGETS by default, in the eclass
preference order, that is from the newest CPython version to oldest,
with alternative Python implementations coming afterwards. This change
will be propagated via the configuration protection mechanism whenever
dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
changes. This will permit the users to interactively confirm
the updates.

If the new default is not correct for you, please use your preferred
configuration update tool to discard or edit the new configuration file.

Furthermore, dev-lang/python will no longer attempt to automatically
update the Python interpreter preference, or pull in eselect-python
automatically. If you wish to continue using it, please install it
manually to ensure that it is not unmerged.
```


--
Best regards,
Micha? Górny
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On 1/24/21 1:21 PM, Micha? Górny wrote:
> Please review the news item inlined below.

What about a tl;dr line explaining whether dev-lang/python-exec is
optionally or mandatory -or better said - if/which user action is expected?

--
Toralf
PGP 23217DA7 9B888F45
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, Jan 24, 2021 at 01:25:13PM +0100, Toralf Förster wrote:
> What about a tl;dr line explaining whether dev-lang/python-exec is
> optionally or mandatory -or better said - if/which user action is expected?
As I understand it user doesn't have anything to do other than either
accept or refuse the CONFIG_PROTECT changes.

Exception could be if they were heavily relying on eselect python to
change on-the-fly using scripts or whatnot.

I originally felt this could go without a news item myself but I did see
a lot of confused users believe eselect python is essential, so an
explanation makes sense.
--
ionen
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 13:25 +0100, Toralf Förster wrote:
> On 1/24/21 1:21 PM, Micha? Górny wrote:
> > Please review the news item inlined below.
>
> What about a tl;dr line explaining whether dev-lang/python-exec is
> optionally or mandatory -or better said - if/which user action is expected?
>

Sent v2.

--
Best regards,
Micha? Górny
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, Jan 24, 2021 at 7:21 AM Micha? Górny <mgorny@gentoo.org> wrote:
>
> For this reason, we have decided to change the default python-exec
> configuration to match PYTHON_TARGETS by default, in the eclass
> preference order, that is from the newest CPython version to oldest,
> with alternative Python implementations coming afterwards. This change
> will be propagated via the configuration protection mechanism whenever
> dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
> changes. This will permit the users to interactively confirm
> the updates.
>
> If the new default is not correct for you, please use your preferred
> configuration update tool to discard or edit the new configuration file.

Could we just spell out what the actual setting is? That way if a
user accepts or rejects the change accidentally it is trivial to fix,
vs making them hunt through the installed files to do a diff...

Nothing wrong with the instructions - I'd just add one line about what
setting controls this.

--
Rich
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 13:53 -0500, Rich Freeman wrote:
> On Sun, Jan 24, 2021 at 7:21 AM Micha? Górny <mgorny@gentoo.org> wrote:
> >
> > For this reason, we have decided to change the default python-exec
> > configuration to match PYTHON_TARGETS by default, in the eclass
> > preference order, that is from the newest CPython version to oldest,
> > with alternative Python implementations coming afterwards. This change
> > will be propagated via the configuration protection mechanism whenever
> > dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
> > changes. This will permit the users to interactively confirm
> > the updates.
> >
> > If the new default is not correct for you, please use your preferred
> > configuration update tool to discard or edit the new configuration file.
>
> Could we just spell out what the actual setting is? That way if a
> user accepts or rejects the change accidentally it is trivial to fix,
> vs making them hunt through the installed files to do a diff...
>
> Nothing wrong with the instructions - I'd just add one line about what
> setting controls this.
>

The exact paths are provided in the second paragraph. Am I missing
something?

--
Best regards,
Micha? Górny
Re: [News item review] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, Jan 24, 2021 at 2:09 PM Micha? Górny <mgorny@gentoo.org> wrote:
>
> On Sun, 2021-01-24 at 13:53 -0500, Rich Freeman wrote:
> > On Sun, Jan 24, 2021 at 7:21 AM Micha? Górny <mgorny@gentoo.org> wrote:
> > >
> > > For this reason, we have decided to change the default python-exec
> > > configuration to match PYTHON_TARGETS by default, in the eclass
> > > preference order, that is from the newest CPython version to oldest,
> > > with alternative Python implementations coming afterwards. This change
> > > will be propagated via the configuration protection mechanism whenever
> > > dev-lang/python-exec-conf is installed or rebuilt due to PYTHON_TARGETS
> > > changes. This will permit the users to interactively confirm
> > > the updates.
> > >
> > > If the new default is not correct for you, please use your preferred
> > > configuration update tool to discard or edit the new configuration file.
> >
> > Could we just spell out what the actual setting is? That way if a
> > user accepts or rejects the change accidentally it is trivial to fix,
> > vs making them hunt through the installed files to do a diff...
> >
> > Nothing wrong with the instructions - I'd just add one line about what
> > setting controls this.
> >
>
> The exact paths are provided in the second paragraph. Am I missing
> something?
>

No - the way this works makes sense now. For some reason I missed it
on the first two reads, which makes me suspect others will as well.
It wasn't the location of the config file I missed, but the fact that
the eclass will just do what eselect python used to do, and thus
trigger config protection (which is at the end of paragraph 4).

For some reason when I read the section about discarding the changes I
was thinking that there was some config toggle to change this behavior
vs the old way things worked. Instead the new behavior is
unconditional, but the updates it makes to the python-exec config can
be rejected.

--
Rich