c++ - pip external headers only for build -
to compile python package use pybind11, header-only c++ library.
i download master (or other branch) in setup.py
such can include while compiling.
how do that?
basically equivalent of git clone https://github.com/wjakob/pybind11.git _ext/pybind11
.
here setup.py
from setuptools import setup, find_packages, extension cxxpart = extension('mymodule.cxxpart', include_dirs = ['_ext/pybind11/include'], extra_compile_args=['-std=c++11'], sources = ['src/cxxpart.cpp']) setup( name = "mymodule", version = "0.1", packages = find_packages(), ext_modules = [cxxpart], install_requires = ['flask'], )
note master , not version on pypi.
not asked perhaps helpful: pybind organization on github has example setup.py creates dependency on pybind11. ensures installing extension first cause pybind11 installed (via pip & pypi).
Comments
Post a Comment