Skip to content

Commit 8818f49

Browse files
committed
Update pybind11 submodule to v2.2
1 parent a3a63d7 commit 8818f49

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '{build}'
2-
image: Visual Studio 2015
2+
image: Visual Studio 2017
33
platform:
44
- x86
55
- x64
@@ -8,7 +8,7 @@ environment:
88
- PYTHON: 27
99
- PYTHON: 36
1010
- CONDA: 27
11-
- CONDA: 35
11+
- CONDA: 36
1212
install:
1313
- ps: |
1414
git submodule update -q --init --recursive

.travis.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: cpp
2+
dist: trusty
23
matrix:
34
include:
45
- os: linux
@@ -8,26 +9,15 @@ matrix:
89
- os: linux
910
env: CONDA=2.7
1011
- os: linux
11-
env: CONDA=3.5
12+
env: CONDA=3.6
1213
- os: osx
1314
env: PYTHON=2.7
1415
- os: osx
1516
env: PYTHON=3.6
1617
- os: osx
1718
env: CONDA=2.7
1819
- os: osx
19-
env: CONDA=3.5
20-
addons:
21-
apt:
22-
sources:
23-
- ubuntu-toolchain-r-test
24-
- deadsnakes
25-
- kubuntu-backports
26-
packages:
27-
- g++-4.8
28-
- python3.5
29-
- python3.5-dev
30-
- cmake
20+
env: CONDA=3.6
3121
before_install:
3222
- |
3323
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi

pybind11

Submodule pybind11 updated 168 files

src/main.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ int add(int i, int j) {
44
return i + j;
55
}
66

7-
int subtract(int i, int j) {
8-
return i - j;
9-
}
10-
117
namespace py = pybind11;
128

13-
PYBIND11_PLUGIN(cmake_example) {
14-
py::module m("cmake_example", R"pbdoc(
9+
PYBIND11_MODULE(cmake_example, m) {
10+
m.doc() = R"pbdoc(
1511
Pybind11 example plugin
1612
-----------------------
1713
@@ -22,25 +18,23 @@ PYBIND11_PLUGIN(cmake_example) {
2218
2319
add
2420
subtract
25-
)pbdoc");
21+
)pbdoc";
2622

2723
m.def("add", &add, R"pbdoc(
2824
Add two numbers
2925
3026
Some other explanation about the add function.
3127
)pbdoc");
3228

33-
m.def("subtract", &subtract, R"pbdoc(
29+
m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc(
3430
Subtract two numbers
3531
3632
Some other explanation about the subtract function.
3733
)pbdoc");
3834

3935
#ifdef VERSION_INFO
40-
m.attr("__version__") = py::str(VERSION_INFO);
36+
m.attr("__version__") = VERSION_INFO;
4137
#else
42-
m.attr("__version__") = py::str("dev");
38+
m.attr("__version__") = "dev";
4339
#endif
44-
45-
return m.ptr();
4640
}

0 commit comments

Comments
 (0)