0

I am building a python package that depends on a C library, which will be called via ctypes. In setup.py, I have:

from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py

class BuildPyCommand(_build_py):
    def run(self):
        # download source files and cmake/make
        # the result is, say "/lib/libexample.so"

setup(...,
    cmdclass={"build_py": BuildPyCommand}
)

When I tried pip install ., the above setup.py was able to compile /lib/libexample.so in the project folder.

Then, now what? How can I make /lib/libexample.so part of the pip installation? Is the above code sufficient?

How should I specify the location of libexample.so for ctypes commands in my package source code?

Chang
  • 812
  • 9
  • 20
  • https://stackoverflow.com/q/37316177/7976758 Found in https://stackoverflow.com/search?q=%5Bsetuptools%5D+distribute+shared+library – phd Mar 16 '22 at 11:45

0 Answers0