Matching package names across distributions

Toshio Kuratomi a.badger at gmail.com
Wed Feb 2 15:13:41 PST 2011


On Wed, Feb 02, 2011 at 05:11:29PM +0000, Enrico Zini wrote:
> On Wed, Feb 02, 2011 at 05:36:25PM +0100, Tarek Ziadé wrote:
> 
> > Interesting ! One thing I would really love to have is the same
> > matching tool for Python projects.
> > 
> > e.g. Distro name <-> Python / PyPI Name
> 
> I use some regexp in distromatch to 'stem' python package names to a
> name which is common across distribution, and which should get quite
> close to the PyPI name. Here they are (the capture parentesis catch
> the name):
> 
>   Debian: ^python\d?-(.+)$
>   Fedora: ^(.+)-python\d?$
>   Mandriva: ^python-(.+)$
>   OpenSUSE: ^python-(.+)$
> 
> This is guesswork, except for Debian for which I know the naming
> policy[1]. Since I'm posting to the list, can people from other
> distributions please check their own python module naming policies and
> let me know if those regexps need to be fixed[2]?
> 
Fedora is ^python\d?-(.+)$

Except when it isn't.  And with some other caveats (esp wrt pypi name).

If a python module is produced as a subpackage of something else (python
bindings provided by a C library are a common case of this) then the
C library packager may have chosen to name the subpackage ^(.+)-python
instead.  Many times, these modules aren't on PyPI so that may not be
a problem in that specific case.

If a python module has "py" as a prefix, the packager is not required to use
python- as the package prefix (for instance, pygtk2) however, if they're
creating a python3 module, they are required to prefix with python3-.

If a package had "." in its name the dots are changed into "-" instead.
(for instance, python-zc-lockfile).

There are sometimes ambiguities in what hte name of a package is and we
don't always use the pypi name in the case of these ambiguities.  We look at
the tarball name, package name as given in upstream websites, and what is
being imported.  In the case of differences between these, we often use the
name being imported but not always.  (For instance, we have
python-ToscaWidgets [ToscaWidgets] and python-migrate [sqlalchemy-migrate]).

There's also a few oddballs which are grandfathered in like: Django and
TurboGears.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/distributions/attachments/20110202/2f5a5b40/attachment.pgp>


More information about the Distributions mailing list