I have a project depending on a shared library. To make it clear from the beginning: the shared library is a pure C library and not a Python library. For reasons of simplici
package_data is for data. setup can do the compilation into an *.so.
Following my solution in python setup.py build ctypes.CDLL: cannot open shared object file: No such file or directory, I think your setup could employ ext_modules and py_modules, something like
setup(name='pkgtest',
py_modules=['pkgtest'],
ext_modules=[Extension('src.libhello', ['src/libhello.c'])]
)