From f5543befc82b6119a7ded132d481fe81f7a79717 Mon Sep 17 00:00:00 2001 From: Tibbs Date: May 19 2016 06:33:48 +0000 Subject: Reorganize Python section and remove pointlessly outdated parts. https://fedorahosted.org/fpc/ticket/627 --- diff --git a/Packaging:Naming.mw b/Packaging:Naming.mw index abade2d..cdd13d0 100644 --- a/Packaging:Naming.mw +++ b/Packaging:Naming.mw @@ -439,45 +439,50 @@ perl-Cache-Cache (Cache-Cache is the CPAN distribution name) == Addon Packages (php modules) == For details on the PHP naming scheme, see [[Packaging/PHP#NamingScheme]] . -== Addon Packages (python modules) == -Packages of python modules (thus they rely on python as a parent) use a slightly different naming scheme. They should take into account the upstream name of the python module. This makes a package name format of python-$NAME. When in doubt, use the name of the module that you type to import it in a script. +== Addon Packages (Python modules) == +Python packaging is complicated by the fact that are two partially incompatible +language versions in use, here called Python2 and Python3. However, the +common case is for one source package to produce a binary package for each +Python version, and this results in a naming convention where the source package +does not generally produce a binary package of the same name. + +The package name should reflect the upstream name of the Python module, and +should generally take into account the name of the module used when importing +it in Python scripts.. This name will be prefixed depending on the type of the package. + +Note that when a module has a dot in its name, the [[#Separators| usual rule]] +about changing "." to "-" applies. + +=== Python source package naming === +Source packages for Python modules should be named using the python- prefix. '''Examples: '''
 python-psycopg  (python module named psycopg)
-python-simpletal (python module named simpletal)
-python-tpg (python module named tpg)
+python-PyQt4 (python module named PyQt4)
 
-When a module has a dot in its name, the [[#Separators| usual rule]] about changing "." to "-" applies. +However, it does occur that two separately maintained modules have the same +name but are targeted against different versions of Python. In this case, +source package for the software targeted at Python2 should take a +python2- prefix, and the source package for the Python3 version +should have a name beginning with python3-. -== Addon Packages (python3 modules) == +=== Python2 binary package naming === +Python2 binary packages should be named using a python2- prefix. -An rpm with a python prefix means a python2 rpm so we need a different prefix to denote python3 packages. For this, we use python3. We have two constraints that the python2 packages don't operate under: +=== Python3 binary package naming === +Python3 binary packages shoud be named with a prefix of python3-. -
    -
  1. We need to be clear about these modules being for python3. Some python2 packages are named using an old, removed exception that allowed them to omit the "python-" prefix if they already had "py" in their names. No such exception has ever existed for python3 modules.
  2. -
  3. Consumers of the packages need to be able to find them even if they don't know whether they're using the python2 or python3 version.
  4. -
+=== Outdated Python package naming conventions === +Previously there were two other conventions for Python package naming, and some +packages using these naming rules persist in Fedora. -So all python3 modules '''MUST''' have python3 in their name. Other than that, the module must be in the same format as the python2 package. Some examples: -{| -! Fedora python 2 package !! Upstream name !! Fedora Python 3 package name -|- -| python-lxml || lxml || python3-lxml -|- -| gstreamer-python || gst-python || gstreamer-python3 -|- -| gnome-python2 || gnome-python || gnome-python3 -|- -| rpm-python || (part of rpm) || rpm-python3 -|- -| python-pygments || pygments || python3-pygments -|- -| pygtk2
(grandfathered in. Named using
a now removed exception) || pygtk || python3-pygtk -|} +* Python2 module packages were named using a python-. +* Python module packages with names containing "py" were not required to use any prefix. +Neither of these may be used for new Python packages. == Addon Packages (R modules) == Packages of R modules (thus they rely on R as a parent) have their own naming scheme. They should take into account the upstream name of the R module. This makes a package name format of R-$NAME. When in doubt, use the name of the module that you type to import it in R.