pybuild renaming extensions breaks upstream code
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
Reply to: