Mailing List Archive

Re: [News item review v2] Python preference to follow PYTHON_TARGETS
Here's v2 with extra 'tl;dr' instructions in first para:

```
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. If you wish
to use the newest Python version present in your PYTHON_TARGETS, you
only have to accept configuration changes. If you wish need
to customize the behavior, read on.

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 v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
Hi,

I am hot happy with this change.

Why must dev-lang/python become special?

eselect is a known interface for most (all?) slotted packages.
Configuration management tools expect that the appropriate module will
be pulled in once you install a slotable package.

You are now forcing everyone to either migrate to a new system (manage
python-exec.conf directly) or ensure they update their world file and
manually ensure that eselect-python is still installed which will make
Python special.

But because dev-lang/python does not call eselect-python anymore it
looks like you cannot retain old, well established behavior across all
slotable packages anymore.


--
Regards,
Thomas Deutschmann / Gentoo Linux Developer
fpr: C4DD 695F A713 8F24 2AA1 5638 5849 7EE5 1D5D 74A5
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On 1/24/21 7:59 AM, Micha? Górny wrote:
> Here's v2 with extra 'tl;dr' instructions in first para:
>
> ```
> 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. If you wish
> to use the newest Python version present in your PYTHON_TARGETS, you
> only have to accept configuration changes. If you wish need
> to customize the behavior, read on.
>
> 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.
>
> ```
>

Has this change already been pushed for unstable? I am running an unstable
system but I still have eselect-python, so I assume not (unless due to my side
error).

Thanks,
Aisha
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
Why not do it the other way around: make eselect-python leading, and
have it populate PYTHON_TARGETS?
It could be a lot more work, but might be more intuitive.

On 1/24/21 4:11 PM, Thomas Deutschmann wrote:
> Hi,
>
> I am hot happy with this change.
>
> Why must dev-lang/python become special?
>
> eselect is a known interface for most (all?) slotted packages.
> Configuration management tools expect that the appropriate module will
> be pulled in once you install a slotable package.
>
> You are now forcing everyone to either migrate to a new system (manage
> python-exec.conf directly) or ensure they update their world file and
> manually ensure that eselect-python is still installed which will make
> Python special.
>
> But because dev-lang/python does not call eselect-python anymore it
> looks like you cannot retain old, well established behavior across all
> slotable packages anymore.
>
>
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, Jan 24, 2021 at 10:16:37AM -0500, Aisha Tammy wrote:
> Has this change already been pushed for unstable? I am running an unstable
> system but I still have eselect-python, so I assume not (unless due to my side
> error).
It was temporarily re-added in deps for the sake of this news item, but
it's not doing anything given the code to use eselect python wasn't
restored. You should have python-exec-conf already doing its thing.
--
ionen
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
??, 24 ???. 2021 ?. ? 12:59, Micha? Górny <mgorny@gentoo.org>:
>
> Here's v2 with extra 'tl;dr' instructions in first para:
>
> ```
> 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. If you wish
> to use the newest Python version present in your PYTHON_TARGETS, you
> only have to accept configuration changes. If you wish need
> to customize the behavior, read on.

typo: wish need

>
> 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.

Perhaps add the "emerge" command here, to avoid users to actually
*manually* installing it? That is, not via the ebuild.

The Russian translation follows. Should I post it as a separate file somewhere?

Title: ???????????? Python ????? ????????? PYTHON_TARGETS

1 ??????? 2021 ???????????? ?????????? ????? ???????? ?? ????? ????? ??????????
???????????????? ?????? Python, ??????? ????? ???????????? ???????? ??????????
PYTHON_TARGETS ? ????????? ???????? ?????????? ????????????. ????? ??
????????? app-eselect/eselect-python ?????????? ? ?? ????????? ?????????? ???
?????????????. ???? ?? ?????? ???????????? ????? ????? ?????? Python ??
????????? ? PYTHON_TARGETS, ??? ???? ?????? ??????? ????????? ????????????.
???? ?? ??? ????? ????????? ?????????????? ?????????, ??????????? ??????.

? 2017 ???? /usr/bin/python ? ???? ???????? ????????????? ?????? ??? ??????
???????? ????????? ? ??????? dev-lang/python-exec. ?????? ????????????????
?????????? Python ???????? ? /etc/python-exec/python-exec.conf ?/??? ?
/etc/python-exec/<?????????>.conf ??? ???????? ? ????????????? ?? ?? ?????????.
??? ???????? ????????????? app-eselect/eselect-python ??????? ????????, ???????
????????? ???? ????.

?????? ??? ?? ???? ???? ???????? ???????? ???????? ?????????????, ???????
?????? ??????????? ????????? python-exec.conf ?????? ???, ????? ????????
?????????? PYTHON_TARGETS. ????????? ?????? ???????? ????????? ??? ?? ????
??????? ????????? ??? ????????, ????????????? ?? ??????????? Gentoo, ?.?. ???
??????????? ????????????? ?????????????? ?????????? Python. ?? ????????????
????????, ???, ????? ???????????? ??? /usr/bin/python ?? ????????? ? ??
PYTHON_TARGETS, ??-?? ????????????????? ???????????? ???????? ????????????????
?????????, ??? ???????????? ???????? ??????????? ?????????.

??????? ?? ?????? ???????? ??????????? ????????? python-exec, ?????? ??? ?????
????????? ? PYTHON_TARGETS ? ??????? ????????????, ???????????? eclass'??:
??????? ??? CPython, ??????? ? ???????? ?????? ? ?????????? ?????????, ?????
?????? ?????????? Python. ??? ????????? ????? ??????????? ? ??????? ? ???????
????????? ?????? ???????????? ?????? ??? ??? ????????? ??? ??????????
dev-lang/python-exec-conf ??-?? ????????? PYTHON_TARGETS. ??? ???? ?
????????????? ????? ??????????? ???????????? ??????????? ?????? ?????????.

???? ????? ????????? ??? ?? ????????, ??????????, ??????????? ??? ???????
?????????? ?????????? ????????????, ????? ????????? ????????? ???
??????????????? ????? ????.

????? ????, dev-lang/python ?????? ?? ????? ???????? ????????????? ????????
???????????????? ?????? Python ? ?????? ?? ????? ????????????? ??????????
eselect-python. ???? ?? ?????? ?????????? ??? ????????????, ??????????,
?????????? ??? ???????, ????? ?? ?? ????????.
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 10:16 -0500, Aisha Tammy wrote:
> On 1/24/21 7:59 AM, Micha? Górny wrote:
> > Here's v2 with extra 'tl;dr' instructions in first para:
> >
> > ```
> > 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. If you wish
> > to use the newest Python version present in your PYTHON_TARGETS, you
> > only have to accept configuration changes. If you wish need
> > to customize the behavior, read on.
> >
> > 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.
> >
> > ```
> >
>
> Has this change already been pushed for unstable? I am running an unstable
> system but I still have eselect-python, so I assume not (unless due to my side
> error).

dev-lang/python-exec-conf is available in ~arch already but app-
eselect/eselect-python is still pulled in unconditionally.


--
Best regards,
Micha? Górny
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 18:16 +0000, Alexey Sokolov wrote:
> ??, 24 ???. 2021 ?. ? 12:59, Micha? Górny <mgorny@gentoo.org>:
> >
> > Here's v2 with extra 'tl;dr' instructions in first para:
> >
> > ```
> > 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. If you wish
> > to use the newest Python version present in your PYTHON_TARGETS, you
> > only have to accept configuration changes. If you wish need
> > to customize the behavior, read on.
>
> typo: wish need

Fixed, thanks.

>
> >
> > 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.
>
> Perhaps add the "emerge" command here, to avoid users to actually
> *manually* installing it? That is, not via the ebuild.

Indeed, I didn't think of this 'manual' ;-). I'll update it and send v3
soonish.

> The Russian translation follows. Should I post it as a separate file somewhere?

Thank you. To be honest, I don't really know what's the process for
localization is. FWICS none of the existing news items includes
translations. In any case, if you don't mind I would prefer if we
waited with this until the final news item is committed, so we don't
have to track changes in it.

>
> Title: ???????????? Python ????? ????????? PYTHON_TARGETS
>
> 1 ??????? 2021 ???????????? ?????????? ????? ???????? ?? ????? ????? ??????????
> ???????????????? ?????? Python, ??????? ????? ???????????? ???????? ??????????
> PYTHON_TARGETS ? ????????? ???????? ?????????? ????????????. ????? ??
> ????????? app-eselect/eselect-python ?????????? ? ?? ????????? ?????????? ???
> ?????????????. ???? ?? ?????? ???????????? ????? ????? ?????? Python ??
> ????????? ? PYTHON_TARGETS, ??? ???? ?????? ??????? ????????? ????????????.
> ???? ?? ??? ????? ????????? ?????????????? ?????????, ??????????? ??????.
>
> ? 2017 ???? /usr/bin/python ? ???? ???????? ????????????? ?????? ??? ??????
> ???????? ????????? ? ??????? dev-lang/python-exec. ?????? ????????????????
> ?????????? Python ???????? ? /etc/python-exec/python-exec.conf ?/??? ?
> /etc/python-exec/<?????????>.conf ??? ???????? ? ????????????? ?? ?? ?????????.
> ??? ???????? ????????????? app-eselect/eselect-python ??????? ????????, ???????
> ????????? ???? ????.
>
> ?????? ??? ?? ???? ???? ???????? ???????? ???????? ?????????????, ???????
> ?????? ??????????? ????????? python-exec.conf ?????? ???, ????? ????????
> ?????????? PYTHON_TARGETS. ????????? ?????? ???????? ????????? ??? ?? ????
> ??????? ????????? ??? ????????, ????????????? ?? ??????????? Gentoo, ?.?. ???
> ??????????? ????????????? ?????????????? ?????????? Python. ?? ????????????
> ????????, ???, ????? ???????????? ??? /usr/bin/python ?? ????????? ? ??
> PYTHON_TARGETS, ??-?? ????????????????? ???????????? ???????? ????????????????
> ?????????, ??? ???????????? ???????? ??????????? ?????????.
>
> ??????? ?? ?????? ???????? ??????????? ????????? python-exec, ?????? ??? ?????
> ????????? ? PYTHON_TARGETS ? ??????? ????????????, ???????????? eclass'??:
> ??????? ??? CPython, ??????? ? ???????? ?????? ? ?????????? ?????????, ?????
> ?????? ?????????? Python. ??? ????????? ????? ??????????? ? ??????? ? ???????
> ????????? ?????? ???????????? ?????? ??? ??? ????????? ??? ??????????
> dev-lang/python-exec-conf ??-?? ????????? PYTHON_TARGETS. ??? ???? ?
> ????????????? ????? ??????????? ???????????? ??????????? ?????? ?????????.
>
> ???? ????? ????????? ??? ?? ????????, ??????????, ??????????? ??? ???????
> ?????????? ?????????? ????????????, ????? ????????? ????????? ???
> ??????????????? ????? ????.
>
> ????? ????, dev-lang/python ?????? ?? ????? ???????? ????????????? ????????
> ???????????????? ?????? Python ? ?????? ?? ????? ????????????? ??????????
> eselect-python. ???? ?? ?????? ?????????? ??? ????????????, ??????????,
> ?????????? ??? ???????, ????? ?? ?? ????????.

--
Best regards,
Micha? Górny
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 16:23 +0100, Hans Fernhout wrote:
> Why not do it the other way around: make eselect-python leading, and
> have it populate PYTHON_TARGETS?
> It could be a lot more work, but might be more intuitive.

It is not possible to do this portably or reliably. My previous
attempts at mangling make.conf have proven mostly destructive to less
typical make.conf files.

--
Best regards,
Micha? Górny
Re: [News item review v2] Python preference to follow PYTHON_TARGETS [ In reply to ]
On Sun, 2021-01-24 at 16:11 +0100, Thomas Deutschmann wrote:
> eselect is a known interface for most (all?) slotted packages.
> Configuration management tools expect that the appropriate module will
> be pulled in once you install a slotable package.

Could you back your claims with specific numbers? How many packages
that do not strictly require eselect to operate are actually pulling
it in?

I don't see a single shell pulling in app-eselect/eselect-sh.

sys-devel/binutils and sys-devel/gcc are probably the most common
examples of packages not using eselect (except for one failed attempt).

> You are now forcing everyone to either migrate to a new system (manage
> python-exec.conf directly) or ensure they update their world file and
> manually ensure that eselect-python is still installed which will make
> Python special.

Is it really that bad to install the tools you actually use instead of
forcing 'one size fits all' approach?

--
Best regards,
Micha? Górny