Distributing pre-built libraries with python modules

后端 未结 1 1974
滥情空心
滥情空心 2021-01-05 20:24

I use the following script to distribute a module containing pure python code.

from distutils.core import setup, Extension
import os
setup (name = \'mtester\         


        
相关标签:
1条回答
  • 2021-01-05 21:07

    Unfortunately package_data looks for files relative to the top of the package. One fix is to move the helper library under the module dir with the rest of the code:

    % mv lib64/mhelper.so module/
    

    Then modify the package_data argument accordingly:

    package_data = {'mtester': ['mhelper.so']}
    ...
    

    Then test:

    % python setup.py bdist
    % tar tf dist/mtester-0.1.linux-x86_64.tar.gz | grep mhelper
    ./usr/local/lib/python2.5/dist-packages/mtester/mhelper.so
    
    0 讨论(0)
提交回复
热议问题