xtensor-stack / xtensor-python

Python bindings for xtensor
BSD 3-Clause "New" or "Revised" License
347 stars 58 forks source link

Support pybind11 master branch (2.3 dev) #164

Closed yungyuc closed 6 years ago

yungyuc commented 6 years ago

The macro PYBIND11_DESCR is removed from pybind11 master (it happened more than a year ago). This is a hack to allow xtensor-python to build.

For testing I tweaked the .travis.yml. Set PYBIND11_VERSION=master environment variable in Travis CI to enable pybind11 master branch.

SylvainCorlay commented 6 years ago

Thanks @yungyuc this looks good!

Looking at what is done in pybind11, it seems that we replacing with auto should be sufficient. What do you think?

https://github.com/pybind/pybind11/blob/7bb1da969a2747c24e6bd29dad6d44c4c5796141/include/pybind11/numpy.h#L1570

yungyuc commented 6 years ago

It works for pybind11 master branch but not v2.2 stable branch. v2.3 changes npy_format_descriptor::name to constexpr auto but it's still a function in v2.2. To support both v2.2 and master, the other approach I thought of was to move away from pybind11 internal.

SylvainCorlay commented 6 years ago

Merging!

Maybe we should ask the pybind11 to make some of that API truly public.