From 3b806d41eb28027a700b5630d931aabbb26ab0bb Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 11 Oct 2015 16:29:35 +0200 Subject: [PATCH] Added configuration files for Travis CI integration --- .travis.yml | 29 +++++++++++++++++++++++++++++ CMakeLists.txt | 6 ++++-- README.md | 2 ++ example/run_test.py | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..17c56ec59 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +language: cpp +sudo: false +addons: + apt: + sources: + - ubuntu-toolchain-r-test + - deadsnakes + packages: + - g++-4.8 + - python3.5 + - python3.5-dev + - python3.5-venv +matrix: + include: + - os: linux + compiler: gcc-4.8 + script: + - pyvenv-3.5 venv + - cmake -DPYBIND_PYTHON_VERSION=3.5 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.5m -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.5m.so -DPYTHON_EXECUTABLE:FILEPATH=`pwd`/venv/bin/python3.5 -DCMAKE_CXX_COMPILER=g++-4.8 + - make -j 2 + - source venv/bin/activate + - pip install numpy + - CTEST_OUTPUT_ON_FAILURE=TRUE make test + - os: osx + compiler: clang + script: + - cmake -DPYBIND_PYTHON_VERSION=2.7 + - make -j 2 + - CTEST_OUTPUT_ON_FAILURE=TRUE make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 574f9fc37..a0ceccf64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() +set(PYBIND_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling the example application") + set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6) -find_package(PythonLibs REQUIRED) -find_package(PythonInterp REQUIRED) +find_package(PythonLibs ${PYBIND_PYTHON_VERSION} REQUIRED) +find_package(PythonInterp ${PYBIND_PYTHON_VERSION} REQUIRED) string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE) if (UNIX) diff --git a/README.md b/README.md index f802d7dea..0bdc1a05b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ # pybind11 — Seamless operability between C++11 and Python +[![Build Status](https://travis-ci.org/wjakob/pybind11.svg?branch=master)](https://travis-ci.org/wjakob/pybind11) + **pybind11** is a lightweight header library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. Its goals and syntax are similar to the excellent diff --git a/example/run_test.py b/example/run_test.py index 373c3d91b..d017031e8 100755 --- a/example/run_test.py +++ b/example/run_test.py @@ -17,7 +17,7 @@ def sanitize(lines): line = "" line = remove_unicode_marker.sub(r'\1', line) line = remove_long_marker.sub(r'\1', line) - line = remove_hex.sub(r'0xHEX', line) + line = remove_hex.sub(r'0', line) line = shorten_floats.sub(r'\1', line) line = line.replace('__builtin__', 'builtins') line = line.replace('example.', '')