[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dh_python2: pyinstall files

I wanted to add flaskext/__init__.py file to python-flask binary package
yesterday and I realized it will require to add too many lines to my
tiny debian/rules file so... I implemented pyinstall feature in
dh_python2 instead (see debpython/tools.py file¹).

If dh_python2 will find debian/pkg.pyinstall file, it will install files
from that file as public modules for all requested Python versions.

Example lines and their debian/rules equivalents (assuming 2.5,
2.6 and 2.7 is in the list of supported Python versions and
X-Python-Version allows all of them):

cp foo.py debian/pkg/usr/lib/python2.5/site-packages/
cp foo.py debian/pkg/usr/lib/python2.6/dist-packages/
cp foo.py debian/pkg/usr/lib/python2.7/dist-packages/

foo/bar.py 2.6-
cp foo/bar.py debian/pkg/usr/lib/python2.6/dist-packages/foo/
cp foo/bar.py debian/pkg/usr/lib/python2.7/dist-packages/foo/

(Scott: I know, I know, I have to change version range syntax, I
will do it some day...)

foo/bar.py spam
cp foo/bar.py debian/pkg/usr/lib/python2.6/site-packages/spam/
cp foo/bar.py debian/pkg/usr/lib/python2.6/dist-packages/spam/
cp foo/bar.py debian/pkg/usr/lib/python2.7/dist-packages/spam/

cp debian/foo.py debian/pkg/usr/lib/python2.6/site-packages/
cp debian/foo.py debian/pkg/usr/lib/python2.6/dist-packages/
cp debian/foo.py debian/pkg/usr/lib/python2.7/dist-packages/

(note that debian dir is skipped, use "debian/foo.py debian" if you want
to use debian namespace)

debian/*.py spam.egg 2.7
cp debian/foo.py debian/pkg/usr/lib/python2.7/dist-packages/spam/egg/
cp debian/bar.py debian/pkg/usr/lib/python2.7/dist-packages/spam/egg/
cp debian/baz.py debian/pkg/usr/lib/python2.7/dist-packages/spam/egg/

What do you think? Is it worth adding also pkg.pyremove and pkg.pyrename
files? What other features would you like to see in dh_python2 or
dh_python3 (pyinstall doesn't make sense in dh_python3 as you can simply
use dh_install to install into /usr/lib/python3/dist-packages/)?

PS anyone wants to help me document all these small features in
dh_python2 manpage? (I will rewrite it in RST and use rst2man, BTW)

[¹] http://alioth.debian.org/scm/loggerhead/pkg-python/python-defaults-debian/annotate/head:/debpython/tools.py
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

Reply to: