[rdo-dev] Managing executables in python2/python3 packages

Alfredo Moralejo Alonso amoralej at redhat.com
Wed Jun 27 08:51:00 UTC 2018

On Tue, Jun 26, 2018 at 11:10 PM, Alan Pevec <apevec at redhat.com> wrote:

> On Tue, Jun 26, 2018 at 7:53 PM, Alfredo Moralejo Alonso
> <amoralej at redhat.com> wrote:
> > As part of the python3 PoC we are working on in rocky cycle i think we
> need
> > to reconsider how we are managing executables in packages with
> > python2/python3 subpackages. Currently, we are following Fedora best
> > practices creating <executable>-<python version> in python{2|3}-<package>
> > packages and making <executable> a symlink for python2 version and
> shipping
> > it only in python2 subpackages.
> This mess is only required when you have both python2 and python3
> subpackage,
> idea was to switch to python3 fully in Fedora and drop python2 as per
> recent Fedora packaging guideline change
> https://pagure.io/packaging-committee/issue/753 "python2-... should
> not be packaged when it's not needed"
> Unversioned <executable> binary then links to the python3 version:
> https://fedoraproject.org/wiki/Packaging:Python#Naming
> > I think this is not a convenient way to manage it for python3
> installations
> > as it requires users (and tools) to use <executable>-3 commands. IMO,
> moving
> > from python2 to python3 should be more transparent from a user PoV.
> >
> > I see some ways we could manage this:
> >
> > 1. Don't build python2 in el7 builds and stop creating
> <executable>-<python
> > version>, just <executable>.
> el7? Did you mean, Fedora? If so, yes, this is solution, as explained
> above.

Yes, i meant Fedora. My only doubt was about timing. Is it ok to start
getting rid of python2 packages for clients in fedora already?, i'm afraid
of breaking things for other projects or users who depend on them.

> > 2. Keep building both and change <executable> symlink to point to
> > <executable>-3 when python3 subpackages are enabled in spec file.
> no, that's against the current Fedora packaging guidelines, which are
> following upstream Python requirement that unversioned "python"
> executes "python2"
> > 3. Keep building both and use alternatives mechanism to manage
> <executable>
> > symlink to point to <executable>-2 or <executable>-3 depending on what is
> > installed (-3 if both are enabled).
> NACK, same as 2.
> > My main doubt is related to how to handle this from a Fedora perspective
> > keeping in mind that we are using the same specs to build packages in
> Fedora
> > repos. I guess the best way to keep both python2 and 3 installations
> working
> > is to use option 3.
> We really do not want to maintain the mess of mixed py2/3 - in Fedora
> all should move to python3,
> while keeping py2 compat for EL7 builds. Looking at how much
> copy/paste there is between py2/3 sections, I wonder if we could just
> generate python3 spec from the python2, with some mappings in Requires
> using pymod2pkg ?
> Cheers,
> Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rdoproject.org/pipermail/dev/attachments/20180627/853843fe/attachment.html>

More information about the dev mailing list