Control: forwarded -1 
https://salsa.debian.org/cpython-team/python3-defaults/merge_requests/2
Control: tags -1 + patch

On Fri, 29 Nov 2019 at 09:37:45 +0000, Simon McVittie wrote:
> I'll send a patch and a merge request when I get a bug number for this.

Please see
https://salsa.debian.org/cpython-team/python3-defaults/merge_requests/2
or the attached.

    smcv
>From 9b86ccebc781d78f8c59074086734226fe326681 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 29 Nov 2019 09:32:25 +0000
Subject: [PATCH] policy: Clarify module package naming

As discussed in the thread starting at
<https://lists.debian.org/debian-python/2019/11/msg00125.html>,
it is not always clear to developers what should be done in cases
where the module name is not obvious:

- if the name contains underscores or capital letters
- if the name in the PKG-INFO is not the same as the name you import

Clarify this based on what I believe to be current best-practice.

Signed-off-by: Simon McVittie <[email protected]>
Closes: #945823
---
 debian/python-policy.dbk | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/debian/python-policy.dbk b/debian/python-policy.dbk
index 856635a..c797954 100644
--- a/debian/python-policy.dbk
+++ b/debian/python-policy.dbk
@@ -624,6 +624,27 @@ executable. See
 	  installs multiple modules, in which case the maintainer shall
 	  choose the name of the module which best represents the package.
 	</para>
+	<para>
+	  For the purposes of package naming, the name that is used for
+	  a module is the name that can be used with <literal>import</literal>,
+	  which is not necessarily the same as the name used in setuptools
+	  <literal>PKG-INFO</literal> and <literal>.egg-info</literal>
+	  files and directories. For example, the module described in
+	  <literal>pyxdg-<replaceable>*</replaceable>.egg-info</literal>
+	  is used via <literal>import xdg</literal>, so its package name
+	  is <literal>python3-xdg</literal> and not
+	  <literal>python3-pyxdg</literal>.
+	</para>
+	<para>
+	  Some modules have names that contain underscores or capital
+	  letters, which are not allowed in Debian package names.
+	  The recommendation is to replace underscores with hyphen/minus
+	  and capital letters with lower-case. For example, the modules
+	  that can be used with <literal>import distro_info</literal> and
+	  <literal>import Xlib</literal> are packaged as
+	  <literal>python3-distro-info</literal> and
+	  <literal>python3-xlib</literal> respectively.
+	</para>
 	<para>
 	  For subpackages such as <replaceable>foo.bar</replaceable>, the recommendation is
 	  to name the binary
-- 
2.24.0

Reply via email to