[Fedora-packaging] Inconsistencies in Python package naming

Bohuslav Kabrda bkabrda at redhat.com
Thu Mar 28 11:47:37 UTC 2013


----- Original Message -----
> On Thu, 28 Mar 2013 05:47:37 -0400 (EDT), Bohuslav Kabrda wrote:
> 
> > Hi all,
> > so after spending some months with Python packaging, I came to
> > think that the naming has to be standardized better.
> > Problem 1:
> > The naming guidelines say, that if there is "py" or "Py" in package
> > name, you _can_ use that name for a package, otherwise use
> > python-{name} [1]. So if I'm trying to install "pygments", I just
> > try "pygments", but whoops - it's named python-pygments. How could
> > I tell?
> >
> 
> "yum search pygments" or the equivalent in a graphical package tool.
> Also "yum list py\*|grep pygments" (or grep -i …) would find it.
> 
> Trial-and-error guessing of package names isn't practical. Searching
> manually in possibly alphabetically sorted lists of thousands of
> packages
> isn't practical either.
> 
> The uppercase "Py" is a good example. In bugzilla, uppercase package
> names
> are listed before lowercase package names. Nasty. A "yum search" and
> "yum list py\*" is case-insensitive, however.
> 
> > Problem 2:
> > If I install "PyYaml" (this time I was lucky and guessed
> > correctly), then it's confusing that I have to install
> > python3-PyYaml. Both should be prefixed "python[possibly 3]-", or
> > none of them.
> >
> 
> When and how to apply such prefixes has confused packagers/reviewers
> before:
> 
>   # yum list django\*|grep ^django|wc -l
>   5
>   # yum list python-django\*|grep ^python-django|wc -l
>   70
> 
> Some of the django-* packages have been renamed, but this shows that
> guessing
> prefixes wouldn't work well either.
> 

That's exactly why I'm proposing a clear and "non-specialcased" approach.

> > Problem 3:
> > The table in [2] is even more confusing. If the upstream name is
> > "pygtk", why should Fedora's package be called "pygtk2"? Where did
> > the "2" come from?
> > 
> 
> The naming is derived from the GTK+ framework base packages: gtk+
> (v1.x),
> gtk2 (v2.x), gtk3 (v3.x).
> 

So why isn't the python 3 package named python3-pygtk2, but just python3-pygtk?

> > Why do we need it if Python 3 version is clearly named
> > "python3-pygtk"?
> 
> ?
> 
> > So my proposal would be:
> > Let's make it mandatory for all the Python package names to be
> > prefixed with python-/python3-. If the upstream name already
> > starts with "python-", then let's use that (possibly inserting the
> > "3").
> >
> 
> Do you propose it just because of the package searching and
> installation
> attempts you've described? What other benefits would there be?
> Currently,
> all Python packages should start with "py" (or "Py"), except if it's
> a package
> that doesn't extend Python but some program (e.g.
> claws-mail-plugins-python).
> 

I don't think that this is "just because". The fact that you have to workaround these by guessing the package names or doing searches prior to installation proves that something is wrong/inconsistent. If you look at naming guidelines for other languages that prepend something Fedora-specific before the actual package name (Ruby, Perl, PHP, ...), you'll see that all of them have completely clear naming scheme.
Also, try to look at some other distro naming rules for Python - e.g. Mageia [1], OpenSuse [2], Debian [3] all name python extension modules python-foo, resp. python3-foo.

> --
> Fedora release 19 (Schrödinger’s Cat) - Linux
> 3.9.0-0.rc4.git0.1.fc19.x86_64
> loadavg: 0.02 0.03 0.11
> --
> packaging mailing list
> packaging at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging

-- 
Regards,
Bohuslav "Slavek" Kabrda.

[1] https://wiki.mageia.org/en/Python_policy#Naming
[2] http://en.opensuse.org/openSUSE:Packaging_Python#Naming_policy
[3] http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html


More information about the packaging mailing list