I'm looking to distribute a Python package that depends on Boost Python, but I'm not sure how to configure the setup.
In the current state, the setup requires the path to the Boost .so to be manually set before running the setup script (example for Python3.7 on Ubuntu commented on the side)
module = setuptools.Extension(
# ...
include_dirs=['path/to/python/version'], # /usr/include/python3.7/
libraries=['boost-so-filename'], # boost_python-py37
library_dirs=['directory/containing/boost/so/'], # /usr/lib/x86_64-linux-gnu/
# ...
)
setup(
# ...,
ext_modules=[module]
# ...,
)
How can I configure setup to be able to support any Python version >=3.7, know where Boost is, and link to the corresponding Boost version for their Python version?
Python packaging: Boost library as dependency suggests using a binary wheel, but I don't think that would necessarily work for supporting multiple versions, and either way I'm not entirely sure how to approach it
A comment in How to package shared objects that python modules depend on? mentions something about having a build script handling this, but it's not elaborated upon.