PyBuild available in raring / experimental

Piotr Ożarowski piotr at debian.org
Mon Jan 28 09:50:16 UTC 2013


[Barry Warsaw, 2013-01-26]
> On Jan 25, 2013, at 05:43 PM, Scott Kitterman wrote:
> 
> >There's another case as well.  If there is pure python code that is python3 
> >version specific.  This is rare, but exists.  To make sip4/python-qt4 support 
> >multiple python versions I had to do some really unfortunate and painful 
> >things to make it work.  It would be nice if we had a general solution for 
> >this.
> 
> Perhaps in those cases, a pybuild option to install into the version specific
> location would be appropriate?

I don't see why this (versioned temp. install dir) is a big deal.
dh_python3 moves these files to the right location some CPU cycles later
and knows a bit more about Python version.

Please note that we still didn't figure out how to deal with libraries
that require Python >= 3.X while X-1 is still supported (in the same
Debian/Ubuntu release or in the previous one - think about upgrades) so
it's not only about .so files (X-Python3-Version is enough in most
cases, but not in all of them as ScottK pointed out - some libraries
install different .py files for different Python version, I had a
similar case with Beaker once - one file/feature was available for
Pytohn >=2.6 while we supported also 2.5 at that time).
I will send a mail with my proposition how to deal with this issue to
debian-python at l.d.o soon.

anyway, if you want to change it now, you can:

  export PYBUILD_INSTALL_ARGS_python3=--install-lib=/usr/lib/python3/

> Matthias reminded me with more detail of why this is.  It's not necessary for
> distutils based packages because the .so's will always get the right PEP 3149
> tag, so you always know what version of Python a shlib is for by looking at
> its file name.

dh_python3 can and is¹ also using tags to detect Python version so in
case of distutils it's needed only in case of different .py files
(if it's a big problem, it can be easily changed in
debpython/build/plugin_distutils.py - that's why pybuild is using plugins :)

[¹] see debpython.interpreter.EXTFILE_RE

> It's for non-distutils based builds which may create unadorned shared libs.
> Unfortunately, the only way I know of to determine the version of Python for
> such shlibs is to brute forcing an import with every available Python, and
> watch for the fatal exception (presumably with a non-zero exit status - I
> haven't tried it).  The one that doesn't fail is the winner.

I think installing to /usr/lib/python3.X/ and merging in dh_python3 is
just easier and covers more cases.


PS please reply to debian-python at lists.debian.org or CC me
-- 
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



More information about the ubuntu-devel mailing list