Re: Should dh_python2 be used for single-file python applications?
* Dmitry Shachnev <mitya57@gmail.com>, 2011-08-14, 13:24:
I have a question about my package "retext".
Upstream tarball provides executable retext.py and wpgen.py files which
are currently dh_install'ed to /usr/bin/retext and /usr/bin/wpgen.
- Should dh_python2 be used in this case
If you case the only thing dh_python2 would do is to put "python" into
python:Depends substitution variable. So no, you don't need it.
Dependencies auto-detect is not needed since most of the imports are
optional and are wrapped into "try-except-else" blocks.
dh_python2 doesn't analyse your import statements. (I don't know where
this misconception comes from...)
- Should I install the python files somewhere to /usr/share/…
That would make sense if your script were currently very big. Otherwise,
I wouldn't bother.
and put wrapper shell-scripts to /usr/bin?
But please write wrapper scripts in Python. (That way a user has an easy
way to run your program with a non-default Python version.)
Should I byte-compile them into .pyc or .pyo?
Yes. This is where dh_python2 is needed.
- Or should I better split python files to module and launcher (in
upstream tarball, since I'm also the upstream author)?
I'm not sure how is that different from the previous option...
And one off-topic question: when Debian will provide Python 3 packages
for modules supporting it? Like python-qt4 (bug 558389) and
python-markdown?
When they are ready, of course. (There's no bug about that against
python-markdown, so how could the maintainer know that a package for
Python 3 is needed?)
BTW, I have impression that debian-mentors is not read by many people
who are experienced in packaging Python software.
debian-python@lists.debian.org might be better place to ask such
questions.
--
Jakub Wilk
Reply to: