Re: dh_python2 extension rename breaking module loading
[Matthias Klose, 2015-02-12] The interpreter doesn't look up the old module name with the multiarch suffix. Best thing would be to rename it manually (removing the module substring. Of course dh_python2 could do that as well. dh_python3 already does that for Python = 3.2. Last time I checked it wasn't needed for Python 2.X. I'll test it later and enable it in dh_python2 as well if it's really needed -- 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 signature.asc Description: Digital signature
Re: dh_python2 extension rename breaking module loading
Thanks Matthias, removing the 'module' infix fixed the problem for me. export PYBUILD_AFTER_INSTALL := \ mv {destdir}{install_dir}/khmer/_khmermodule.so \ {destdir}{install_dir}/khmer/_khmer.so On Thu Feb 12 2015 at 10:55:16 AM Matthias Klose d...@debian.org wrote: On 02/11/2015 04:04 PM, Michael Crusoe wrote: Hello, I'm working on the packaging of the khmer project[0] with the debian-med team[1] and we've run into an odd problem: dh_python2 renames the Python extension shared library from `_khmermodule.so` to a version with a mutliarch triplet: `_khmermodule.x86_64-linux-gnu.so`. This breaks module loading: ImportError: No module named _khmer. The interpreter doesn't look up the old module name with the multiarch suffix. Best thing would be to rename it manually (removing the module substring. Of course dh_python2 could do that as well.
Re: dh_python2 extension rename breaking module loading
On February 11, 2015 10:04:50 AM EST, Michael Crusoe michael.cru...@gmail.com wrote: Hello, I'm working on the packaging of the khmer project[0] with the debian-med team[1] and we've run into an odd problem: dh_python2 renames the Python extension shared library from `_khmermodule.so` to a version with a mutliarch triplet: `_khmermodule.x86_64-linux-gnu.so`. This breaks module loading: ImportError: No module named _khmer. I've found the '--no-ext-rename' option but I can't seem to figure out how to use it with the debhelper command sequencer + dh_python2 + pybuild setup: http://anonscm.debian.org/cgit/debian-med/khmer.git/tree/debian/rules In the mean time I've worked around this via dh_link[2]. Is there a better way? Thanks, [0] http://khmer.readthedocs.org [1] http://anonscm.debian.org/cgit/debian-med/khmer.git [2] http://anonscm.debian.org/cgit/debian-med/khmer.git/tree/debian/khmer.links Given the filename, shouldn't it be import khmermodule? Scott K -- To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/77b55bd4-8831-4005-8add-3181e5640...@kitterman.com
Re: dh_python2 extension rename breaking module loading
On 11 February 2015 at 14:22, Scott Kitterman deb...@kitterman.com wrote: Given the filename, shouldn't it be import khmermodule? foomodule.so was a valid filename for a module 'foo' - though I only heard about this when that spelling was removed in Python 3.3: https://docs.python.org/3/whatsnew/3.3.html#building-c-extensions