[Python-modules-team] Bug#736878: python-django: Please provide python3-django

Barry Warsaw barry at debian.org
Tue Jun 17 21:26:15 UTC 2014


On Jun 17, 2014, at 08:52 AM, Raphael Hertzog wrote:

>(CCing Barry who expressed interested in python3-django as well)

I started a *very* minimal branch for adding Python 3 packaging to
python-django 1.6, although 1.6.5 is the latest on PyPI (and in Debian).
There's really not much to my branch that can't be easily reproduced better
based on the current packaging.

For decent setup.py-based bilingual upstream projects, it's generally pretty
easy to add Python 3 support.  This wiki page has lots of good details:

https://wiki.debian.org/Python/LibraryStyleGuide

For pure libraries, there are tons of existing examples.  You can start with
most of the packages I'm maintaining in Debian:

http://qa.debian.org/developer.php?login=barry&comaint=yes

It can be a little trickier for packages that also contain executables,
because in general we don't want both Python 2 and Python 3 versions /usr/bin
scripts.  There are a few exceptions where the shebang line is meaningful, but
usually we just want /usr/bin to be shebang /usr/bin/python3.  Recent uploads
of mine for tox and virtualenv can serve as examples for these.

>I have not yet converted any package to python 3 so I should look
>up how to do it.

Indeed!  It's easy and fun. :)

>I think the basic idea should be along this:
>
>- enable dh_python3
>- add binary package python3-django with the relevant files and binary
>  dependencies

Also, adopt the pybuild build system.

>One question where I don't have a clear answer is whether we should try
>to put the code in some python-django-common package because otherwise
>python3-django and python-django contain the same set of files just
>in different directories (and with different dependencies). The answer is
>probably yes because the package is relatively big... but then I don't
>know of any Python package where the code lies in a dependency and where
>the binary package just provides the byte-compiling glue for a specific
>Python version.

Python source files should not be shared between the python- and python3-
(i.e. Python 2 and 3) stacks.  Each binary library package will have its own
copy of source files, but you *can* share source files for multiple versions
of Python 3.  pybuild mostly does this for you automatically.  You only have
to worry if e.g. something is Python 3.4 compatible but not Python 3.5
compatible.  Since Jessie is about to drop Python 3.3 any day now, and Python
3.5 is a *long* way off, you really only have to care about Python 2.7 and
3.4.  Still, your library should install into /usr/lib/python3 not
/usr/lib/python3.4.  pybuild has a few minor gotchas for some odd packages,
but you may not encounter it, and if you do, contact us on #debian-python or
debian-python@ so we can help you smooth those out.

Non-source files *should* be moved into a separate, common binary package.
Examples of these are data files, manpages, documentation, etc.  Depending on
the specifics of the package, I can help you figure out how to partition
things.  I also generally move executables to a separate binary package too.
Thus you might see some of these binary packages:

python-foo - the Python 2 library
python3-foo - the Python 3 library
{python-,}foo-common - common stuff like data files
{python-,}foo-bin - /usr/bin executable and manpages

There are lots of ways do it.  The only requirements are that the Python 2
library goes in python-foo and Python 3 library goes in python3-foo.

>If anyone knows a sample package where we can get inspiration from, please
>let us know.

See above.

Hope that helps!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20140617/f774b8c3/attachment-0001.sig>


More information about the Python-modules-team mailing list