[Python-apps-team] How to package a program for python2 or python3?

Rogério Brito rbrito at ime.usp.br
Fri Nov 8 01:48:18 UTC 2013


Dear Ben,

On Oct 25 2013, Ben Finney wrote:
> Rogério Brito <rbrito at ime.usp.br> writes:
> > I maintain a moderately popular program called youtube-dl that is
> > currently set up to run in Debian with Python 2.
> 
> Thank you for maintaining this application for Debian users.

Thank you for taking the time to answer my e-mail. I missed it because I am
not subscribed to this list. I would like to kindly ask that you include me
in CC'ies when you answer this message.

I had to take it from the (lossy) list archives, since the list doesn't seem
to be archived in Gmane's system.

> So, if you're going to target Python 2 and Python 3, you need to make
> separate binary packages for those separate runtime systems.

Do I *have* to? :(

> What is problematic is the OS-unfriendly nature of the standard Python
> installation tools, making it difficult to install packages to
> FHS-conformant locations. But here again I think the Debhelper tools for
> Python are useful at smoothing these edges.

Thanks, indeed, they do, but I am not really sure how I should proceed.
The program was totally "librarized" and its entry point is now simply a
wrapper that imports the main module and calls the main function.

So, should I create a dummy youtube-dl (binary) package that depends on each
of two other packages, containing the modules (say, python-youtube-dl and
python3-youtube-dl)?

And what tools are available to help with this splitting? Should I use
dh_python2 and dh_python3? The current packaging is really a vanilla thing...

> > I would sincerely like to avoid creating a separate binary package, if
> > possible.
> 
> Why is that? I think it is normal practice in Debian's Python packages
> to target Python 2 and Python 3 with separate binary packages. If you
> can say what in particular you'd like to avoid, maybe a solution can be
> suggested.

I don't really think that it feels right. The same source code being
duplicated in two packages just feels like the incorrect approach.

There's also the pain of going through the NEW queue again, but the primary
reason is, indeed, the duplication. The code is the same, after all.


Thanks again,

-- 
Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA
http://rb.doesntexist.org/blog : Projects : https://github.com/rbrito/
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br



More information about the Python-apps-team mailing list