Skip to content

Support pybind11 master branch (2.3 dev)#164

Merged
SylvainCorlay merged 2 commits into
xtensor-stack:masterfrom
yungyuc:pybind11-2.3
Sep 11, 2018
Merged

Support pybind11 master branch (2.3 dev)#164
SylvainCorlay merged 2 commits into
xtensor-stack:masterfrom
yungyuc:pybind11-2.3

Conversation

@yungyuc
Copy link
Copy Markdown
Contributor

@yungyuc yungyuc commented Sep 9, 2018

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.

Add a Travis-CI environment variable: PYBIND11_VERSION.  All build flavors use it.

Also remove unnecessary comments after ifdef.
@SylvainCorlay
Copy link
Copy Markdown
Member

SylvainCorlay commented Sep 10, 2018

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
Copy link
Copy Markdown
Contributor Author

yungyuc commented Sep 11, 2018

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
Copy link
Copy Markdown
Member

Merging!

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

@SylvainCorlay SylvainCorlay merged commit 35af439 into xtensor-stack:master Sep 11, 2018
@yungyuc yungyuc deleted the pybind11-2.3 branch September 15, 2018 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants