diff --git a/.appveyor.yml b/.appveyor.yml index 0371462..1d09092 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ version: '{build}' -image: Visual Studio 2015 +image: Visual Studio 2017 platform: - x86 - x64 @@ -8,7 +8,7 @@ environment: - PYTHON: 27 - PYTHON: 36 - CONDA: 27 - - CONDA: 35 + - CONDA: 36 install: - ps: | git submodule update -q --init --recursive diff --git a/.travis.yml b/.travis.yml index dc0a1c0..e78ba31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: cpp +dist: trusty matrix: include: - os: linux @@ -8,7 +9,7 @@ matrix: - os: linux env: CONDA=2.7 - os: linux - env: CONDA=3.5 + env: CONDA=3.6 - os: osx env: PYTHON=2.7 - os: osx @@ -16,18 +17,7 @@ matrix: - os: osx env: CONDA=2.7 - os: osx - env: CONDA=3.5 -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - deadsnakes - - kubuntu-backports - packages: - - g++-4.8 - - python3.5 - - python3.5-dev - - cmake + env: CONDA=3.6 before_install: - | if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi diff --git a/pybind11 b/pybind11 index e33ef9c..2a5a5ec 160000 --- a/pybind11 +++ b/pybind11 @@ -1 +1 @@ -Subproject commit e33ef9c20d36fe760792c61ccc95ecf1b42cf81d +Subproject commit 2a5a5ec0a47c245fbf1bb1a8a90b4c3278e01693 diff --git a/src/main.cpp b/src/main.cpp index 8e11800..86ab582 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,14 +4,10 @@ int add(int i, int j) { return i + j; } -int subtract(int i, int j) { - return i - j; -} - namespace py = pybind11; -PYBIND11_PLUGIN(cmake_example) { - py::module m("cmake_example", R"pbdoc( +PYBIND11_MODULE(cmake_example, m) { + m.doc() = R"pbdoc( Pybind11 example plugin ----------------------- @@ -22,7 +18,7 @@ PYBIND11_PLUGIN(cmake_example) { add subtract - )pbdoc"); + )pbdoc"; m.def("add", &add, R"pbdoc( Add two numbers @@ -30,17 +26,15 @@ PYBIND11_PLUGIN(cmake_example) { Some other explanation about the add function. )pbdoc"); - m.def("subtract", &subtract, R"pbdoc( + m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc( Subtract two numbers Some other explanation about the subtract function. )pbdoc"); #ifdef VERSION_INFO - m.attr("__version__") = py::str(VERSION_INFO); + m.attr("__version__") = VERSION_INFO; #else - m.attr("__version__") = py::str("dev"); + m.attr("__version__") = "dev"; #endif - - return m.ptr(); }