Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8627

pybuild renaming extensions breaks upstream code

From Afif Elghraoui <afif@debian.org>
Newsgroups linux.debian.maint.python
Subject pybuild renaming extensions breaks upstream code
Date 2016-07-03 01:40 +0200
Message-ID <rQCFX-1o7-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,
I'm maintaining a set of python modules that have this pattern of code
for finding compiled extensions (this example is from the kineticstools
package):

~~~
        if platform.system() == "Windows":

            libfn = "tree_predict.dll"
            path = os.path.dirname(os.path.abspath(__file__))
            windowsLib = path + os.path.sep + libfn

            if os.path.exists(windowsLib):
                self._lib = np.ctypeslib.load_library(libfn, path)
            else:
                raise Exception("can't find tree_predict.dll")
        else:
            DLL_PATH = _getAbsPath("tree_predict.so")

            if os.path.exists(DLL_PATH):
                self._lib = np.ctypeslib.load_library("tree_predict.so",
DLL_PATH)
            else:
                raise Exception("can't find tree_predict.so")
~~~

When the package is built and the architecture is renamed:

I: dh_python2 fs:322: renaming tree_predict.so to
tree_predict.x86_64-linux-gnu.so

the upstream code breaks. What I've done in the past is patch it so that
it searches for the extension the way we rename it (which I get using
sysconfig.get_config_var('MULTIARCH')) as in the patch at

http://anonscm.debian.org/git/debian-med/pbh5tools.git/tree/debian/patches/multiarch-module-path.patch

Is there a better way around this problem?

Many thanks and regards
Afif


-- 
Afif Elghraoui | عفيف الغراوي
http://afif.ghraoui.name

Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

pybuild renaming extensions breaks upstream code Afif Elghraoui <afif@debian.org> - 2016-07-03 01:40 +0200
  Re: pybuild renaming extensions breaks upstream code Dmitry Shachnev <mitya57@debian.org> - 2016-07-03 08:30 +0200
    Re: pybuild renaming extensions breaks upstream code Afif Elghraoui <afif@ghraoui.name> - 2016-07-03 12:00 +0200
      Re: pybuild renaming extensions breaks upstream code Dmitry Shachnev <mitya57@debian.org> - 2016-07-04 17:30 +0200

csiph-web