From 726e57df5a14145d5658c739a78a1892b8e5cebe Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Tue, 26 Mar 2019 19:06:44 -0400 Subject: [PATCH 01/34] Fixes for CI * Fix warning that not including a cmake source or build dir will be a fatal error (it is now on newest CMakes) * Fixes appveyor * Travis uses CMake 3.9 for more than a year now * Travis dropped sudo: false in December --- .appveyor.yml | 1 + .travis.yml | 33 ++++++++++++++------------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0eb6aa5bcb..79a5916c73 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -62,6 +62,7 @@ build_script: -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DCMAKE_SUPPRESS_REGENERATION=1 + . - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - cmake --build . --config %CONFIG% --target pytest -- /m /v:m /logger:%MSBuildLogger% - cmake --build . --config %CONFIG% --target cpptest -- /m /v:m /logger:%MSBuildLogger% diff --git a/.travis.yml b/.travis.yml index d7f300e6b4..43f8446fac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: cpp dist: trusty -sudo: false matrix: include: # This config does a few things: @@ -33,7 +32,7 @@ matrix: diff -rq $installed ./include/pybind11 - | # Barebones build - cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) + cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . make pytest -j 2 make cpptest -j 2 # The following are regular test configurations, including optional dependencies. @@ -49,14 +48,11 @@ matrix: apt: sources: [deadsnakes] packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] - - sudo: true - services: docker + - services: docker env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - - sudo: true - services: docker + - services: docker env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - - sudo: true - services: docker + - services: docker env: PYTHON=3.6 CPP=17 GCC=7 - os: linux env: PYTHON=3.6 CPP=17 CLANG=5.0 @@ -72,18 +68,17 @@ matrix: env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux - env: PYPY=5.8 PYTHON=2.7 CPP=11 GCC=4.8 + env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 addons: apt: packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version - - sudo: true - services: docker + - services: docker env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 script: - | $SCRIPT_RUN_PREFIX sh -c "set -e - cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 + cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . make install cp -a tests /pybind11-tests mkdir /build-tests && cd /build-tests @@ -131,9 +126,9 @@ before_install: SCRIPT_RUN_PREFIX="docker exec --tty $containerid" $SCRIPT_RUN_PREFIX sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done' else - if [ "$PYPY" = "5.8" ]; then - curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux64.tar.bz2 | tar xj - PY_CMD=$(echo `pwd`/pypy2-v5.8.0-linux64/bin/pypy) + if [ "$PYPY" = "7.1" ]; then + curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2 | tar xj + PY_CMD=$(echo `pwd`/pypy2.7-v7.1.0-linux64/bin/pypy) CMAKE_EXTRA_ARGS+=" -DPYTHON_EXECUTABLE:FILEPATH=$PY_CMD" else PY_CMD=python$PYTHON @@ -148,12 +143,14 @@ before_install: if [ "$PY" = 3 ] || [ -n "$PYPY" ]; then $PY_CMD -m ensurepip --user fi + $PY_CMD --version $PY_CMD -m pip install --user --upgrade pip wheel fi set +e install: - | # Install dependencies + cmake --version set -e if [ -n "$DOCKER" ]; then if [ -n "$DEBUG" ]; then @@ -174,10 +171,7 @@ install: git clone https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx -b release_50 git clone https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi -b release_50 mkdir llvm-build && cd llvm-build - # Building llvm requires a newer cmake than is provided by the trusty container: - CMAKE_VER=cmake-3.8.0-Linux-x86_64 - curl https://cmake.org/files/v3.8/$CMAKE_VER.tar.gz | tar xz - ./$CMAKE_VER/bin/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local ../llvm-source + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local ../llvm-source make -j2 install-cxxabi install-cxx cp -a include/c++/v1/*cxxabi*.h ~/.local/include/c++/v1 cd .. @@ -206,6 +200,7 @@ script: -DPYBIND11_CPP_STANDARD=$CPP -DPYBIND11_WERROR=${WERROR:-ON} -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} + . - $SCRIPT_RUN_PREFIX make pytest -j 2 - $SCRIPT_RUN_PREFIX make cpptest -j 2 - if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi From 82349ce7944cfcc82d08d67d9d15f8e37c287dfd Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Fri, 29 Mar 2019 00:54:21 +0100 Subject: [PATCH 02/34] See if clang 7 works --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43f8446fac..8c586bfbdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,11 +55,11 @@ matrix: - services: docker env: PYTHON=3.6 CPP=17 GCC=7 - os: linux - env: PYTHON=3.6 CPP=17 CLANG=5.0 + env: PYTHON=3.6 CPP=17 CLANG=7 addons: apt: - sources: [deadsnakes, llvm-toolchain-trusty-5.0, ubuntu-toolchain-r-test] - packages: [python3.6-dev python3.6-venv clang-5.0 llvm-5.0-dev, lld-5.0] + sources: [deadsnakes, llvm-toolchain-trusty-7, ubuntu-toolchain-r-test] + packages: [python3.6-dev python3.6-venv clang-7 llvm-7-dev, lld-7] - os: osx osx_image: xcode7.3 env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 @@ -163,13 +163,13 @@ install: libeigen3-dev libboost-dev cmake make ${EXTRA_PACKAGES} && break; done" else - if [ "$CLANG" = "5.0" ]; then + if [ "$CLANG" = "7" ]; then if ! [ -d ~/.local/include/c++/v1 ]; then - # Neither debian nor llvm provide a libc++ 5.0 deb; luckily it's fairly quick + # Neither debian nor llvm provide a libc++ 5.1 deb; luckily it's fairly quick # to build, install (and cache), so do it ourselves: git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source - git clone https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx -b release_50 - git clone https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi -b release_50 + git clone https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx -b release_70 + git clone https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi -b release_70 mkdir llvm-build && cd llvm-build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local ../llvm-source make -j2 install-cxxabi install-cxx From 4986bdb53a7b3077e135bf6aa3f4ebf1c093272d Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Fri, 29 Mar 2019 17:50:22 +0100 Subject: [PATCH 03/34] Dropping Sphinx 2 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c586bfbdf..a7e720b687 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ matrix: - pyenv global $(pyenv whence 2to3) # activate all python versions - PY_CMD=python3 - $PY_CMD -m pip install --user --upgrade pip wheel setuptools - install: - - $PY_CMD -m pip install --user --upgrade sphinx sphinx_rtd_theme breathe flake8 pep8-naming pytest + install: # Breathe does not yet support Sphinx 2 + - $PY_CMD -m pip install --user --upgrade sphinx<2 sphinx_rtd_theme breathe flake8 pep8-naming pytest - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" script: From de87a196745fa66b7db1672b567930750b32594d Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 30 Mar 2019 10:05:51 +0100 Subject: [PATCH 04/34] A few cleanups --- .travis.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7e720b687..c3ae6e576c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: - PY_CMD=python3 - $PY_CMD -m pip install --user --upgrade pip wheel setuptools install: # Breathe does not yet support Sphinx 2 - - $PY_CMD -m pip install --user --upgrade sphinx<2 sphinx_rtd_theme breathe flake8 pep8-naming pytest + - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" script: @@ -54,6 +54,10 @@ matrix: env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - services: docker env: PYTHON=3.6 CPP=17 GCC=7 + addons: + apt: + sources: + - deadsnakes - os: linux env: PYTHON=3.6 CPP=17 CLANG=7 addons: @@ -164,22 +168,7 @@ install: else if [ "$CLANG" = "7" ]; then - if ! [ -d ~/.local/include/c++/v1 ]; then - # Neither debian nor llvm provide a libc++ 5.1 deb; luckily it's fairly quick - # to build, install (and cache), so do it ourselves: - git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source - git clone https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx -b release_70 - git clone https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi -b release_70 - mkdir llvm-build && cd llvm-build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local ../llvm-source - make -j2 install-cxxabi install-cxx - cp -a include/c++/v1/*cxxabi*.h ~/.local/include/c++/v1 - cd .. - fi - export CXXFLAGS="-isystem $HOME/.local/include/c++/v1 -stdlib=libc++" - export LDFLAGS="-L$HOME/.local/lib -fuse-ld=lld-$CLANG" - export LD_LIBRARY_PATH="$HOME/.local/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - if [ "$CPP" = "-std=c++17" ]; then CPP="-std=c++1z"; fi + export CXXFLAGS="-stdlib=libc++" fi export NPY_NUM_BUILD_JOBS=2 From 90ad2182aca0dff22f090672b8566e0f306f41a5 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 30 Mar 2019 10:20:50 +0100 Subject: [PATCH 05/34] More changes --- .travis.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3ae6e576c..ed000b61b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,18 +52,30 @@ matrix: env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - services: docker env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - - services: docker - env: PYTHON=3.6 CPP=17 GCC=7 + - env: PYTHON=3.6 CPP=17 GCC=7 addons: apt: sources: - deadsnakes + - ubuntu-toolchain-r-test + packages: + - python3.6-dev + - python3.6-venv + - g++-7 - os: linux env: PYTHON=3.6 CPP=17 CLANG=7 addons: apt: - sources: [deadsnakes, llvm-toolchain-trusty-7, ubuntu-toolchain-r-test] - packages: [python3.6-dev python3.6-venv clang-7 llvm-7-dev, lld-7] + sources: + - deadsnakes + - llvm-toolchain-trusty-7 + packages: + - python3.6-dev + - python3.6-venv + - clang-7 + - llvm-7-dev + - lld-7 + - libstdc++7 - os: osx osx_image: xcode7.3 env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 From 7e66dce4f2eed3b8a7ff04b12594c3a3190e7aa0 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 15:58:28 -0400 Subject: [PATCH 06/34] DNM Disable successful builds --- .travis.yml | 134 ++++++++++++++++++++++++++-------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed000b61b3..46e42a8be3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,56 +2,56 @@ language: cpp dist: trusty matrix: include: - # This config does a few things: - # - Checks C++ and Python code styles (check-style.sh and flake8). - # - Makes sure sphinx can build the docs without any errors or warnings. - # - Tests setup.py sdist and install (all header files should be present). - # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and - # also tests the automatic discovery functions in CMake (Python version, C++ standard). - - os: linux - dist: xenial # Necessary to run doxygen 1.8.15 - env: STYLE DOCS PIP - cache: false - before_install: - - pyenv global $(pyenv whence 2to3) # activate all python versions - - PY_CMD=python3 - - $PY_CMD -m pip install --user --upgrade pip wheel setuptools - install: # Breathe does not yet support Sphinx 2 - - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest - - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" - script: - - tools/check-style.sh - - flake8 - - $PY_CMD -m sphinx -W -b html docs docs/.build - - | - # Make sure setup.py distributes and installs all the headers - $PY_CMD setup.py sdist - $PY_CMD -m pip install --user -U ./dist/* - installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") - diff -rq $installed ./include/pybind11 - - | - # Barebones build - cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . - make pytest -j 2 - make cpptest -j 2 - # The following are regular test configurations, including optional dependencies. - # With regard to each other they differ in Python version, C++ standard and compiler. - - os: linux - env: PYTHON=2.7 CPP=11 GCC=4.8 - addons: - apt: - packages: [cmake=2.\*, cmake-data=2.\*] - - os: linux - env: PYTHON=3.6 CPP=11 GCC=4.8 - addons: - apt: - sources: [deadsnakes] - packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] - - services: docker - env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - - services: docker - env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + # # This config does a few things: + # # - Checks C++ and Python code styles (check-style.sh and flake8). + # # - Makes sure sphinx can build the docs without any errors or warnings. + # # - Tests setup.py sdist and install (all header files should be present). + # # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and + # # also tests the automatic discovery functions in CMake (Python version, C++ standard). + # - os: linux + # dist: xenial # Necessary to run doxygen 1.8.15 + # env: STYLE DOCS PIP + # cache: false + # before_install: + # - pyenv global $(pyenv whence 2to3) # activate all python versions + # - PY_CMD=python3 + # - $PY_CMD -m pip install --user --upgrade pip wheel setuptools + # install: # Breathe does not yet support Sphinx 2 + # - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest + # - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz + # - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" + # script: + # - tools/check-style.sh + # - flake8 + # - $PY_CMD -m sphinx -W -b html docs docs/.build + # - | + # # Make sure setup.py distributes and installs all the headers + # $PY_CMD setup.py sdist + # $PY_CMD -m pip install --user -U ./dist/* + # installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") + # diff -rq $installed ./include/pybind11 + # - | + # # Barebones build + # cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . + # make pytest -j 2 + # make cpptest -j 2 + # # The following are regular test configurations, including optional dependencies. + # # With regard to each other they differ in Python version, C++ standard and compiler. + # - os: linux + # env: PYTHON=2.7 CPP=11 GCC=4.8 + # addons: + # apt: + # packages: [cmake=2.\*, cmake-data=2.\*] + # - os: linux + # env: PYTHON=3.6 CPP=11 GCC=4.8 + # addons: + # apt: + # sources: [deadsnakes] + # packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] + # - services: docker + # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + # - services: docker + # env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - env: PYTHON=3.6 CPP=17 GCC=7 addons: apt: @@ -76,12 +76,12 @@ matrix: - llvm-7-dev - lld-7 - libstdc++7 - - os: osx - osx_image: xcode7.3 - env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 - - os: osx - osx_image: xcode9 - env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 + # - os: osx + # osx_image: xcode7.3 + # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 + # - os: osx + # osx_image: xcode9 + # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 @@ -89,17 +89,17 @@ matrix: apt: packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version - - services: docker - env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 - script: - - | - $SCRIPT_RUN_PREFIX sh -c "set -e - cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . - make install - cp -a tests /pybind11-tests - mkdir /build-tests && cd /build-tests - cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON - make pytest -j 2" + # - services: docker + # env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 + # script: + # - | + # $SCRIPT_RUN_PREFIX sh -c "set -e + # cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . + # make install + # cp -a tests /pybind11-tests + # mkdir /build-tests && cd /build-tests + # cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON + # make pytest -j 2" cache: directories: - $HOME/.local/bin From 859e3e8f7dfd2ff4e29a07e818d6950232a4b1c4 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 15:42:52 -0400 Subject: [PATCH 07/34] TMP Test using Xenial for C++17 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 46e42a8be3..ac0efa4bd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ matrix: # - services: docker # env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - env: PYTHON=3.6 CPP=17 GCC=7 + dist: xenial addons: apt: sources: @@ -63,6 +64,7 @@ matrix: - python3.6-venv - g++-7 - os: linux + dist: xenial env: PYTHON=3.6 CPP=17 CLANG=7 addons: apt: From 487b7dab3876a5dc993ba8452b01f31e8d250fe3 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:05:49 -0400 Subject: [PATCH 08/34] Make things noisy --- .travis.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac0efa4bd9..6b99b98bf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,6 +111,7 @@ cache: before_install: - | # Configure build variables + set -x if [ "$TRAVIS_OS_NAME" = "linux" ]; then if [ -n "$CLANG" ]; then export CXX=clang++-$CLANG CC=clang-$CLANG @@ -132,7 +133,7 @@ before_install: if [ -n "$DEBUG" ]; then CMAKE_EXTRA_ARGS+=" -DCMAKE_BUILD_TYPE=Debug"; fi - | # Initialize environment - set -e + set -ex if [ -n "$DOCKER" ]; then docker pull $DOCKER @@ -164,12 +165,12 @@ before_install: $PY_CMD --version $PY_CMD -m pip install --user --upgrade pip wheel fi - set +e + set +ex install: - | # Install dependencies + set -ex cmake --version - set -e if [ -n "$DOCKER" ]; then if [ -n "$DEBUG" ]; then PY_DEBUG="python$PYTHON-dbg python$PY-scipy-dbg" @@ -196,17 +197,22 @@ install: tar --extract -j --directory=eigen --strip-components=1 export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH:+$CMAKE_INCLUDE_PATH:}$PWD/eigen" fi - set +e + set +ex script: -- $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} +- set -x + $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_PYTHON_VERSION=$PYTHON -DPYBIND11_CPP_STANDARD=$CPP -DPYBIND11_WERROR=${WERROR:-ON} -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} . -- $SCRIPT_RUN_PREFIX make pytest -j 2 -- $SCRIPT_RUN_PREFIX make cpptest -j 2 -- if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi +- set -x + $SCRIPT_RUN_PREFIX make pytest -j 2 +- set -x + $SCRIPT_RUN_PREFIX make cpptest -j 2 +- set -x + if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi after_failure: cat tests/test_cmake_build/*.log* after_script: -- if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi +- set -x + if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi From 69e00df0c8c03271437a01459fc543931999626b Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:26:55 -0400 Subject: [PATCH 09/34] Disable docker; fix LLVM PPA for Xenial --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b99b98bf7..b5fbf2687c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ matrix: apt: sources: - deadsnakes - - llvm-toolchain-trusty-7 + - llvm-toolchain-xenial-7 packages: - python3.6-dev - python3.6-venv @@ -122,9 +122,9 @@ before_install: fi export CXX=g++-$GCC CC=gcc-$GCC fi - if [ "$GCC" = "6" ]; then DOCKER=${ARCH:+$ARCH/}debian:stretch - elif [ "$GCC" = "7" ]; then DOCKER=debian:buster EXTRA_PACKAGES+=" catch python3-distutils" DOWNLOAD_CATCH=OFF - fi + #if [ "$GCC" = "6" ]; then DOCKER=${ARCH:+$ARCH/}debian:stretch + #elif [ "$GCC" = "7" ]; then DOCKER=debian:buster EXTRA_PACKAGES+=" catch python3-distutils" DOWNLOAD_CATCH=OFF + #fi elif [ "$TRAVIS_OS_NAME" = "osx" ]; then export CXX=clang++ CC=clang; fi From 70af89f80984a03b10cc892b2201b3303836ecfd Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:32:15 -0400 Subject: [PATCH 10/34] Fix syntax errors --- .travis.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5fbf2687c..fb95de2866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -199,20 +199,25 @@ install: fi set +ex script: -- set -x +- | + set -x $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_PYTHON_VERSION=$PYTHON -DPYBIND11_CPP_STANDARD=$CPP -DPYBIND11_WERROR=${WERROR:-ON} -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} . -- set -x +- | + set -x $SCRIPT_RUN_PREFIX make pytest -j 2 -- set -x +- | + set -x $SCRIPT_RUN_PREFIX make cpptest -j 2 -- set -x +- | + set -x if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi after_failure: cat tests/test_cmake_build/*.log* after_script: -- set -x +- | + set -x if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi From 27664ae8ec197812f425f787b9fadfd0b5cd6760 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:39:28 -0400 Subject: [PATCH 11/34] Moar fix --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb95de2866..513b03f097 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,6 @@ matrix: - clang-7 - llvm-7-dev - lld-7 - - libstdc++7 # - os: osx # osx_image: xcode7.3 # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 @@ -201,11 +200,11 @@ install: script: - | set -x - $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} - -DPYBIND11_PYTHON_VERSION=$PYTHON - -DPYBIND11_CPP_STANDARD=$CPP - -DPYBIND11_WERROR=${WERROR:-ON} - -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} + $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} \ + -DPYBIND11_PYTHON_VERSION=$PYTHON \ + -DPYBIND11_CPP_STANDARD=$CPP \ + -DPYBIND11_WERROR=${WERROR:-ON} \ + -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} \ . - | set -x From 8a42d3d71f3a6ea87ef1ef5afad89430cf1f5b8f Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:47:03 -0400 Subject: [PATCH 12/34] Oops --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 513b03f097..0ef67facfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,6 +77,7 @@ matrix: - clang-7 - llvm-7-dev - lld-7 + - libc++-7-dev # - os: osx # osx_image: xcode7.3 # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 From 516528c6bdf80b93dfd167de8ec6e9f120686e2e Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 16:51:27 -0400 Subject: [PATCH 13/34] Try fixing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0ef67facfa..a1e6787b64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,7 @@ matrix: - llvm-7-dev - lld-7 - libc++-7-dev + - libc++abi-7-dev # Why is this necessary??? # - os: osx # osx_image: xcode7.3 # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 From c1d8031c041f9962095a933387e72479e8f23627 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:01:15 -0400 Subject: [PATCH 14/34] Fix virtual thing --- tests/test_gil_scoped.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_gil_scoped.cpp b/tests/test_gil_scoped.cpp index a94b7a2e27..cb0010ee6b 100644 --- a/tests/test_gil_scoped.cpp +++ b/tests/test_gil_scoped.cpp @@ -13,6 +13,7 @@ class VirtClass { public: + virtual ~VirtClass() {} virtual void virtual_func() {} virtual void pure_virtual_func() = 0; }; From 652153bceb6bfdec949fead35a6fb81a367e653b Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:14:38 -0400 Subject: [PATCH 15/34] Try local config? --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1e6787b64..1bb491a6a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,10 +75,7 @@ matrix: - python3.6-dev - python3.6-venv - clang-7 - - llvm-7-dev - - lld-7 - - libc++-7-dev - - libc++abi-7-dev # Why is this necessary??? + - libclang-7-dev # - os: osx # osx_image: xcode7.3 # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 From 712bebce4ac2fcff587ef5f94e4aa3ad3f48375f Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:22:10 -0400 Subject: [PATCH 16/34] Lotsa warninsg --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1bb491a6a8..db3b8e15c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,6 +76,10 @@ matrix: - python3.6-venv - clang-7 - libclang-7-dev + - llvm-7-dev + - lld-7 + - libc++-7-dev + - libc++abi-7-dev # Why is this necessary??? # - os: osx # osx_image: xcode7.3 # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 From 43368747c9dc894feb159ce241d218d9da8d8a19 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:31:14 -0400 Subject: [PATCH 17/34] Use explicit std::move for type conversion --- tests/test_kwargs_and_defaults.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_kwargs_and_defaults.cpp b/tests/test_kwargs_and_defaults.cpp index 2263b6b7a4..6563fb9ad3 100644 --- a/tests/test_kwargs_and_defaults.cpp +++ b/tests/test_kwargs_and_defaults.cpp @@ -34,7 +34,9 @@ TEST_SUBMODULE(kwargs_and_defaults, m) { m.def("kw_func_udl_z", kw_func, "x"_a, "y"_a=0); // test_args_and_kwargs - m.def("args_function", [](py::args args) -> py::tuple { return args; }); + m.def("args_function", [](py::args args) -> py::tuple { + return std::move(args); + }); m.def("args_kwargs_function", [](py::args args, py::kwargs kwargs) { return py::make_tuple(args, kwargs); }); From 75849e5971c8aa0c6090c2f99e3cf741bec185f1 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:47:36 -0400 Subject: [PATCH 18/34] Address more warnings --- .travis.yml | 2 ++ include/pybind11/numpy.h | 4 ++-- tests/test_smart_ptr.cpp | 4 +++- tests/test_virtual_functions.cpp | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index db3b8e15c2..c0190100fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -186,6 +186,8 @@ install: if [ "$CLANG" = "7" ]; then export CXXFLAGS="-stdlib=libc++" + # Suppress this warning b/c it's inherent to how `py::self` is used for overloads + export CXXFLAGS="$CXXFLAGS -Wno-self-assign-overloaded" fi export NPY_NUM_BUILD_JOBS=2 diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 37471d8be9..ca954f59f2 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -1509,7 +1509,7 @@ struct vectorize_helper { if (trivial == broadcast_trivial::f_trivial) result = array_t(shape); else result = array_t(shape); - if (size == 0) return result; + if (size == 0) return std::move(result); /* Call the function */ if (trivial == broadcast_trivial::non_trivial) @@ -1517,7 +1517,7 @@ struct vectorize_helper { else apply_trivial(buffers, params, result.mutable_data(), size, i_seq, vi_seq, bi_seq); - return result; + return std::move(result); } template diff --git a/tests/test_smart_ptr.cpp b/tests/test_smart_ptr.cpp index 5f1fd07df4..87c9be8c2b 100644 --- a/tests/test_smart_ptr.cpp +++ b/tests/test_smart_ptr.cpp @@ -336,7 +336,9 @@ TEST_SUBMODULE(smart_ptr, m) { // test_shared_ptr_gc // #187: issue involving std::shared_ptr<> return value policy & garbage collection - struct ElementBase { virtual void foo() { } /* Force creation of virtual table */ }; + struct ElementBase { + virtual ~ElementBase() { } /* Force creation of virtual table */ + }; py::class_>(m, "ElementBase"); struct ElementA : ElementBase { diff --git a/tests/test_virtual_functions.cpp b/tests/test_virtual_functions.cpp index c9a561c09f..ccf018d997 100644 --- a/tests/test_virtual_functions.cpp +++ b/tests/test_virtual_functions.cpp @@ -129,6 +129,7 @@ class Movable { class NCVirt { public: + virtual ~NCVirt() { } virtual NonCopyable get_noncopyable(int a, int b) { return NonCopyable(a, b); } virtual Movable get_movable(int a, int b) = 0; From cd59a0978ec73b5e9e8d3a308bec23ac2e0d9e14 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:56:08 -0400 Subject: [PATCH 19/34] DNM Disable failing PyPy and now successful GCC7 --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index c0190100fb..dd3f2245df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,17 +52,17 @@ matrix: # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 # - services: docker # env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - - env: PYTHON=3.6 CPP=17 GCC=7 - dist: xenial - addons: - apt: - sources: - - deadsnakes - - ubuntu-toolchain-r-test - packages: - - python3.6-dev - - python3.6-venv - - g++-7 + # - env: PYTHON=3.6 CPP=17 GCC=7 + # dist: xenial + # addons: + # apt: + # sources: + # - deadsnakes + # - ubuntu-toolchain-r-test + # packages: + # - python3.6-dev + # - python3.6-venv + # - g++-7 - os: linux dist: xenial env: PYTHON=3.6 CPP=17 CLANG=7 @@ -87,11 +87,11 @@ matrix: # osx_image: xcode9 # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - - os: linux - env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 - addons: - apt: - packages: [libblas-dev, liblapack-dev, gfortran] + # - os: linux + # env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 + # addons: + # apt: + # packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version # - services: docker # env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 From 60158a15254bc66709c61fa7754cd953c5fa8a08 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 17:56:25 -0400 Subject: [PATCH 20/34] Increase verbosity; why aren't CXXFLAGS making it? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dd3f2245df..bd6173c0ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -213,7 +213,7 @@ script: . - | set -x - $SCRIPT_RUN_PREFIX make pytest -j 2 + $SCRIPT_RUN_PREFIX make pytest -j 2 VERBOSE=1 - | set -x $SCRIPT_RUN_PREFIX make cpptest -j 2 From 014f4ffbb4b05c41124de0caa32f1c2a6d62b000 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:04:54 -0400 Subject: [PATCH 21/34] Shift suppression to code --- .travis.yml | 2 -- tests/test_operator_overloading.cpp | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd6173c0ae..e1b90f9e52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -186,8 +186,6 @@ install: if [ "$CLANG" = "7" ]; then export CXXFLAGS="-stdlib=libc++" - # Suppress this warning b/c it's inherent to how `py::self` is used for overloads - export CXXFLAGS="$CXXFLAGS -Wno-self-assign-overloaded" fi export NPY_NUM_BUILD_JOBS=2 diff --git a/tests/test_operator_overloading.cpp b/tests/test_operator_overloading.cpp index 4ad34d104c..e9dbaf320b 100644 --- a/tests/test_operator_overloading.cpp +++ b/tests/test_operator_overloading.cpp @@ -62,6 +62,22 @@ namespace std { }; } +#pragma GCC diagnostic push +// clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to +// `-Wall`, which is used here for overloading (e.g. `py::self += py::self `). +// Here, we suppress the warning using `#pragma diagnostic`. +// Taken from: https://github.com/RobotLocomotion/drake/commit/aaf84b46 +// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`). +#if (__APPLE__) && (__clang__) + #if (__clang_major__ >= 10) && (__clang_minor__ >= 0) && (__clang_patchlevel__ >= 1) + #pragma GCC diagnostic ignored "-Wself-assign-overloaded" + #endif +#elif (__clang__) + #if (__clang_major__ >= 7) + #pragma GCC diagnostic ignored "-Wself-assign-overloaded" + #endif +#endif + TEST_SUBMODULE(operators, m) { // test_operator_overloading @@ -144,3 +160,5 @@ TEST_SUBMODULE(operators, m) { .def_readwrite("b", &NestC::b); m.def("get_NestC", [](const NestC &c) { return c.value; }); } + +#pragma GCC diagnostic pop From 6cbbdf7c2149cb897d0ad2b5df1da31504f8cee1 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:20:56 -0400 Subject: [PATCH 22/34] Revert "DNM Disable failing PyPy and now successful GCC7" This reverts commit cd59a0978ec73b5e9e8d3a308bec23ac2e0d9e14. --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1b90f9e52..43fff346a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,17 +52,17 @@ matrix: # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 # - services: docker # env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - # - env: PYTHON=3.6 CPP=17 GCC=7 - # dist: xenial - # addons: - # apt: - # sources: - # - deadsnakes - # - ubuntu-toolchain-r-test - # packages: - # - python3.6-dev - # - python3.6-venv - # - g++-7 + - env: PYTHON=3.6 CPP=17 GCC=7 + dist: xenial + addons: + apt: + sources: + - deadsnakes + - ubuntu-toolchain-r-test + packages: + - python3.6-dev + - python3.6-venv + - g++-7 - os: linux dist: xenial env: PYTHON=3.6 CPP=17 CLANG=7 @@ -87,11 +87,11 @@ matrix: # osx_image: xcode9 # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - # - os: linux - # env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 - # addons: - # apt: - # packages: [libblas-dev, liblapack-dev, gfortran] + - os: linux + env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 + addons: + apt: + packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version # - services: docker # env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 From aa9996f1c88fb612fb709056158031319b3e8f58 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:21:34 -0400 Subject: [PATCH 23/34] Revert "DNM Disable successful builds" This reverts commit 7e66dce4f2eed3b8a7ff04b12594c3a3190e7aa0. --- .travis.yml | 134 ++++++++++++++++++++++++++-------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43fff346a8..c608cb726e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,56 +2,56 @@ language: cpp dist: trusty matrix: include: - # # This config does a few things: - # # - Checks C++ and Python code styles (check-style.sh and flake8). - # # - Makes sure sphinx can build the docs without any errors or warnings. - # # - Tests setup.py sdist and install (all header files should be present). - # # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and - # # also tests the automatic discovery functions in CMake (Python version, C++ standard). - # - os: linux - # dist: xenial # Necessary to run doxygen 1.8.15 - # env: STYLE DOCS PIP - # cache: false - # before_install: - # - pyenv global $(pyenv whence 2to3) # activate all python versions - # - PY_CMD=python3 - # - $PY_CMD -m pip install --user --upgrade pip wheel setuptools - # install: # Breathe does not yet support Sphinx 2 - # - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest - # - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - # - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" - # script: - # - tools/check-style.sh - # - flake8 - # - $PY_CMD -m sphinx -W -b html docs docs/.build - # - | - # # Make sure setup.py distributes and installs all the headers - # $PY_CMD setup.py sdist - # $PY_CMD -m pip install --user -U ./dist/* - # installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") - # diff -rq $installed ./include/pybind11 - # - | - # # Barebones build - # cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . - # make pytest -j 2 - # make cpptest -j 2 - # # The following are regular test configurations, including optional dependencies. - # # With regard to each other they differ in Python version, C++ standard and compiler. - # - os: linux - # env: PYTHON=2.7 CPP=11 GCC=4.8 - # addons: - # apt: - # packages: [cmake=2.\*, cmake-data=2.\*] - # - os: linux - # env: PYTHON=3.6 CPP=11 GCC=4.8 - # addons: - # apt: - # sources: [deadsnakes] - # packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] - # - services: docker - # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - # - services: docker - # env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + # This config does a few things: + # - Checks C++ and Python code styles (check-style.sh and flake8). + # - Makes sure sphinx can build the docs without any errors or warnings. + # - Tests setup.py sdist and install (all header files should be present). + # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and + # also tests the automatic discovery functions in CMake (Python version, C++ standard). + - os: linux + dist: xenial # Necessary to run doxygen 1.8.15 + env: STYLE DOCS PIP + cache: false + before_install: + - pyenv global $(pyenv whence 2to3) # activate all python versions + - PY_CMD=python3 + - $PY_CMD -m pip install --user --upgrade pip wheel setuptools + install: # Breathe does not yet support Sphinx 2 + - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest + - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz + - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" + script: + - tools/check-style.sh + - flake8 + - $PY_CMD -m sphinx -W -b html docs docs/.build + - | + # Make sure setup.py distributes and installs all the headers + $PY_CMD setup.py sdist + $PY_CMD -m pip install --user -U ./dist/* + installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") + diff -rq $installed ./include/pybind11 + - | + # Barebones build + cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . + make pytest -j 2 + make cpptest -j 2 + # The following are regular test configurations, including optional dependencies. + # With regard to each other they differ in Python version, C++ standard and compiler. + - os: linux + env: PYTHON=2.7 CPP=11 GCC=4.8 + addons: + apt: + packages: [cmake=2.\*, cmake-data=2.\*] + - os: linux + env: PYTHON=3.6 CPP=11 GCC=4.8 + addons: + apt: + sources: [deadsnakes] + packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] + - services: docker + env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + - services: docker + env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - env: PYTHON=3.6 CPP=17 GCC=7 dist: xenial addons: @@ -80,12 +80,12 @@ matrix: - lld-7 - libc++-7-dev - libc++abi-7-dev # Why is this necessary??? - # - os: osx - # osx_image: xcode7.3 - # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 - # - os: osx - # osx_image: xcode9 - # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 + - os: osx + osx_image: xcode7.3 + env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 + - os: osx + osx_image: xcode9 + env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 @@ -93,17 +93,17 @@ matrix: apt: packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version - # - services: docker - # env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 - # script: - # - | - # $SCRIPT_RUN_PREFIX sh -c "set -e - # cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . - # make install - # cp -a tests /pybind11-tests - # mkdir /build-tests && cd /build-tests - # cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON - # make pytest -j 2" + - services: docker + env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 + script: + - | + $SCRIPT_RUN_PREFIX sh -c "set -e + cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . + make install + cp -a tests /pybind11-tests + mkdir /build-tests && cd /build-tests + cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON + make pytest -j 2" cache: directories: - $HOME/.local/bin From 5338d5cf1bbcb5c5d743063e0402bbe7e0909bd4 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:22:20 -0400 Subject: [PATCH 24/34] Cleanup; Make docker explicit --- .travis.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index c608cb726e..51935f5f1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,10 +48,8 @@ matrix: apt: sources: [deadsnakes] packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] - - services: docker - env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - - services: docker - env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + - env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + - env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - env: PYTHON=3.6 CPP=17 GCC=7 dist: xenial addons: @@ -88,15 +86,17 @@ matrix: env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux - env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 + # WARNING: This is currently broken!!! (Due to PyPy refcounting changes, etc.) + env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 EXPECT_FAILURE addons: apt: packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version - services: docker - env: ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 + env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 script: - | + set -x $SCRIPT_RUN_PREFIX sh -c "set -e cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . make install @@ -104,6 +104,7 @@ matrix: mkdir /build-tests && cd /build-tests cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON make pytest -j 2" + set +x cache: directories: - $HOME/.local/bin @@ -124,8 +125,6 @@ before_install: fi export CXX=g++-$GCC CC=gcc-$GCC fi - #if [ "$GCC" = "6" ]; then DOCKER=${ARCH:+$ARCH/}debian:stretch - #elif [ "$GCC" = "7" ]; then DOCKER=debian:buster EXTRA_PACKAGES+=" catch python3-distutils" DOWNLOAD_CATCH=OFF #fi elif [ "$TRAVIS_OS_NAME" = "osx" ]; then export CXX=clang++ CC=clang; @@ -133,6 +132,7 @@ before_install: if [ -n "$CPP" ]; then CPP=-std=c++$CPP; fi if [ "${PYTHON:0:1}" = "3" ]; then PY=3; fi if [ -n "$DEBUG" ]; then CMAKE_EXTRA_ARGS+=" -DCMAKE_BUILD_TYPE=Debug"; fi + set +x - | # Initialize environment set -ex @@ -209,17 +209,22 @@ script: -DPYBIND11_WERROR=${WERROR:-ON} \ -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} \ . + set +x - | set -x $SCRIPT_RUN_PREFIX make pytest -j 2 VERBOSE=1 + set +x - | set -x $SCRIPT_RUN_PREFIX make cpptest -j 2 + set +x - | set -x if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi + set +x after_failure: cat tests/test_cmake_build/*.log* after_script: - | set -x if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi + set +x From e1c33006bbbd24b58e783804b6fda7cba7e6b809 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:31:10 -0400 Subject: [PATCH 25/34] Make each os + dist explicit --- .travis.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51935f5f1e..28dd362aab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: cpp -dist: trusty matrix: include: # This config does a few things: @@ -38,20 +37,30 @@ matrix: # The following are regular test configurations, including optional dependencies. # With regard to each other they differ in Python version, C++ standard and compiler. - os: linux + dist: trusty env: PYTHON=2.7 CPP=11 GCC=4.8 addons: apt: packages: [cmake=2.\*, cmake-data=2.\*] - os: linux + dist: trusty env: PYTHON=3.6 CPP=11 GCC=4.8 addons: apt: sources: [deadsnakes] - packages: [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*] - - env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - - env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - - env: PYTHON=3.6 CPP=17 GCC=7 + packages: [python3.6-dev, python3.6-venv, cmake=2.\*, cmake-data=2.\*] + - os: linux + dist: trusty + env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + - os: linux + dist: trusty + env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + addons: + apt: + packages: [python3.5-dev, python3.5-venv] + - os: linux dist: xenial + env: PYTHON=3.6 CPP=17 GCC=7 addons: apt: sources: @@ -86,13 +95,16 @@ matrix: env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux + dist: trusty # WARNING: This is currently broken!!! (Due to PyPy refcounting changes, etc.) env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 EXPECT_FAILURE addons: apt: packages: [libblas-dev, liblapack-dev, gfortran] # Build in 32-bit mode and tests against the CMake-installed version - - services: docker + - os: linux + dist: trusty + services: docker env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 script: - | From 038969a5a83b51e3b8249f771c1ce929d3ac713e Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:36:01 -0400 Subject: [PATCH 26/34] Normalize formatting --- .travis.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28dd362aab..12c4bd1b26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ matrix: # also tests the automatic discovery functions in CMake (Python version, C++ standard). - os: linux dist: xenial # Necessary to run doxygen 1.8.15 + # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead? env: STYLE DOCS PIP cache: false before_install: @@ -41,14 +42,21 @@ matrix: env: PYTHON=2.7 CPP=11 GCC=4.8 addons: apt: - packages: [cmake=2.\*, cmake-data=2.\*] + packages: + - cmake=2.\* + - cmake-data=2.\* - os: linux dist: trusty env: PYTHON=3.6 CPP=11 GCC=4.8 addons: apt: - sources: [deadsnakes] - packages: [python3.6-dev, python3.6-venv, cmake=2.\*, cmake-data=2.\*] + sources: + - deadsnakes + packages: + - python3.6-dev + - python3.6-venv + - cmake=2.\* + - cmake-data=2.\* - os: linux dist: trusty env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 @@ -57,7 +65,9 @@ matrix: env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 addons: apt: - packages: [python3.5-dev, python3.5-venv] + packages: + - python3.5-dev + - python3.5-venv - os: linux dist: xenial env: PYTHON=3.6 CPP=17 GCC=7 @@ -100,7 +110,10 @@ matrix: env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 EXPECT_FAILURE addons: apt: - packages: [libblas-dev, liblapack-dev, gfortran] + packages: + - libblas-dev + - liblapack-dev + - gfortran # Build in 32-bit mode and tests against the CMake-installed version - os: linux dist: trusty From 7737fdda18df7a75c91f0dd95cdc1b4506bb692a Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 18:43:59 -0400 Subject: [PATCH 27/34] Remove venv from 3.5? --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 12c4bd1b26..6ed5908eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,6 @@ matrix: apt: packages: - python3.5-dev - - python3.5-venv - os: linux dist: xenial env: PYTHON=3.6 CPP=17 GCC=7 From d226544cc8838388e989345b6cdb18fd81f97368 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 19:03:20 -0400 Subject: [PATCH 28/34] Fixes --- .travis.yml | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ed5908eeb..5e532d3e89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,13 +60,24 @@ matrix: - os: linux dist: trusty env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 - os: linux dist: trusty env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 addons: apt: + sources: + - ubuntu-toolchain-r-test packages: + - g++-6 - python3.5-dev + - python3.5-venv + - python-pip-whl - os: linux dist: xenial env: PYTHON=3.6 CPP=17 GCC=7 @@ -76,9 +87,9 @@ matrix: - deadsnakes - ubuntu-toolchain-r-test packages: + - g++-7 - python3.6-dev - python3.6-venv - - g++-7 - os: linux dist: xenial env: PYTHON=3.6 CPP=17 CLANG=7 @@ -120,7 +131,7 @@ matrix: env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 script: - | - set -x + set -ex $SCRIPT_RUN_PREFIX sh -c "set -e cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . make install @@ -128,7 +139,7 @@ matrix: mkdir /build-tests && cd /build-tests cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON make pytest -j 2" - set +x + set +ex cache: directories: - $HOME/.local/bin @@ -138,7 +149,7 @@ cache: before_install: - | # Configure build variables - set -x + set -ex if [ "$TRAVIS_OS_NAME" = "linux" ]; then if [ -n "$CLANG" ]; then export CXX=clang++-$CLANG CC=clang-$CLANG @@ -156,7 +167,7 @@ before_install: if [ -n "$CPP" ]; then CPP=-std=c++$CPP; fi if [ "${PYTHON:0:1}" = "3" ]; then PY=3; fi if [ -n "$DEBUG" ]; then CMAKE_EXTRA_ARGS+=" -DCMAKE_BUILD_TYPE=Debug"; fi - set +x + set +ex - | # Initialize environment set -ex @@ -226,29 +237,29 @@ install: set +ex script: - | - set -x + set -ex $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} \ -DPYBIND11_PYTHON_VERSION=$PYTHON \ -DPYBIND11_CPP_STANDARD=$CPP \ -DPYBIND11_WERROR=${WERROR:-ON} \ -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} \ . - set +x + set +ex - | - set -x + set -ex $SCRIPT_RUN_PREFIX make pytest -j 2 VERBOSE=1 - set +x + set +ex - | - set -x + set -ex $SCRIPT_RUN_PREFIX make cpptest -j 2 - set +x + set +ex - | - set -x + set -ex if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi - set +x + set +ex after_failure: cat tests/test_cmake_build/*.log* after_script: - | - set -x + set -ex if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi - set +x + set +ex From 5d06a0e1cebd004c72f5fe68d66188d099299846 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sat, 30 Mar 2019 19:27:49 -0400 Subject: [PATCH 29/34] Switch back to docker for Trusty Python 3.5 --- .travis.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e532d3e89..8c7d18f935 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,16 +68,10 @@ matrix: - g++-6 - os: linux dist: trusty - env: PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - - python3.5-dev - - python3.5-venv - - python-pip-whl + # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but + # seems to have apt conflicts (at least for Trusty). Use Docker instead. + services: docker + env: DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - os: linux dist: xenial env: PYTHON=3.6 CPP=17 GCC=7 From bf44d1e4b995d2ab5785bd1a4c5afaf6d6375d7f Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Sun, 31 Mar 2019 11:48:27 -0400 Subject: [PATCH 30/34] Revert pypy upgrade --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c7d18f935..944f5a8674 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,8 +110,7 @@ matrix: # Test a PyPy 2.7 build - os: linux dist: trusty - # WARNING: This is currently broken!!! (Due to PyPy refcounting changes, etc.) - env: PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8 EXPECT_FAILURE + env: PYPY=5.8 PYTHON=2.7 CPP=11 GCC=4.8 addons: apt: packages: @@ -176,9 +175,9 @@ before_install: SCRIPT_RUN_PREFIX="docker exec --tty $containerid" $SCRIPT_RUN_PREFIX sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done' else - if [ "$PYPY" = "7.1" ]; then - curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2 | tar xj - PY_CMD=$(echo `pwd`/pypy2.7-v7.1.0-linux64/bin/pypy) + if [ "$PYPY" = "5.8" ]; then + curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux64.tar.bz2 | tar xj + PY_CMD=$(echo `pwd`/pypy2-v5.8.0-linux64/bin/pypy) CMAKE_EXTRA_ARGS+=" -DPYTHON_EXECUTABLE:FILEPATH=$PY_CMD" else PY_CMD=python$PYTHON From 0bbd2dd045f51b211082270104f0c89ac6c322bc Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Wed, 3 Apr 2019 22:02:54 -0400 Subject: [PATCH 31/34] Constrain PYPY package versions --- .travis.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 944f5a8674..59996bc7e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -218,8 +218,15 @@ install: export NPY_NUM_BUILD_JOBS=2 echo "Installing pytest, numpy, scipy..." - ${PYPY:+travis_wait 30} $PY_CMD -m pip install --user --upgrade pytest numpy scipy \ - ${PYPY:+--extra-index-url https://imaginary.ca/trusty-pypi} + local PIP_CMD="" + if [ -n $PYPY ]; then + # For expediency, install only versions that are available on the extra index. + travis_wait 30 \ + $PY_CMD -m pip install --user --upgrade --extra-index-url https://imaginary.ca/trusty-pypi \ + pytest numpy==1.15.4 scipy==1.2.0 + else + $PY_CMD -m pip install --user --upgrade pytest numpy scipy + fi echo "done." mkdir eigen From 4702fda3a96e1a14750cb3b4c54b5e6e70d465ab Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Wed, 3 Apr 2019 22:03:59 -0400 Subject: [PATCH 32/34] DNM Only test PyPy --- .travis.yml | 230 ++++++++++++++++++++++++++-------------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59996bc7e2..cae7a3ac5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,106 +7,106 @@ matrix: # - Tests setup.py sdist and install (all header files should be present). # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and # also tests the automatic discovery functions in CMake (Python version, C++ standard). - - os: linux - dist: xenial # Necessary to run doxygen 1.8.15 - # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead? - env: STYLE DOCS PIP - cache: false - before_install: - - pyenv global $(pyenv whence 2to3) # activate all python versions - - PY_CMD=python3 - - $PY_CMD -m pip install --user --upgrade pip wheel setuptools - install: # Breathe does not yet support Sphinx 2 - - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest - - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" - script: - - tools/check-style.sh - - flake8 - - $PY_CMD -m sphinx -W -b html docs docs/.build - - | - # Make sure setup.py distributes and installs all the headers - $PY_CMD setup.py sdist - $PY_CMD -m pip install --user -U ./dist/* - installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") - diff -rq $installed ./include/pybind11 - - | - # Barebones build - cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . - make pytest -j 2 - make cpptest -j 2 - # The following are regular test configurations, including optional dependencies. - # With regard to each other they differ in Python version, C++ standard and compiler. - - os: linux - dist: trusty - env: PYTHON=2.7 CPP=11 GCC=4.8 - addons: - apt: - packages: - - cmake=2.\* - - cmake-data=2.\* - - os: linux - dist: trusty - env: PYTHON=3.6 CPP=11 GCC=4.8 - addons: - apt: - sources: - - deadsnakes - packages: - - python3.6-dev - - python3.6-venv - - cmake=2.\* - - cmake-data=2.\* - - os: linux - dist: trusty - env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - - os: linux - dist: trusty - # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but - # seems to have apt conflicts (at least for Trusty). Use Docker instead. - services: docker - env: DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - - os: linux - dist: xenial - env: PYTHON=3.6 CPP=17 GCC=7 - addons: - apt: - sources: - - deadsnakes - - ubuntu-toolchain-r-test - packages: - - g++-7 - - python3.6-dev - - python3.6-venv - - os: linux - dist: xenial - env: PYTHON=3.6 CPP=17 CLANG=7 - addons: - apt: - sources: - - deadsnakes - - llvm-toolchain-xenial-7 - packages: - - python3.6-dev - - python3.6-venv - - clang-7 - - libclang-7-dev - - llvm-7-dev - - lld-7 - - libc++-7-dev - - libc++abi-7-dev # Why is this necessary??? - - os: osx - osx_image: xcode7.3 - env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 - - os: osx - osx_image: xcode9 - env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 + # - os: linux + # dist: xenial # Necessary to run doxygen 1.8.15 + # # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead? + # env: STYLE DOCS PIP + # cache: false + # before_install: + # - pyenv global $(pyenv whence 2to3) # activate all python versions + # - PY_CMD=python3 + # - $PY_CMD -m pip install --user --upgrade pip wheel setuptools + # install: # Breathe does not yet support Sphinx 2 + # - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest + # - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz + # - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" + # script: + # - tools/check-style.sh + # - flake8 + # - $PY_CMD -m sphinx -W -b html docs docs/.build + # - | + # # Make sure setup.py distributes and installs all the headers + # $PY_CMD setup.py sdist + # $PY_CMD -m pip install --user -U ./dist/* + # installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") + # diff -rq $installed ./include/pybind11 + # - | + # # Barebones build + # cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . + # make pytest -j 2 + # make cpptest -j 2 + # # The following are regular test configurations, including optional dependencies. + # # With regard to each other they differ in Python version, C++ standard and compiler. + # - os: linux + # dist: trusty + # env: PYTHON=2.7 CPP=11 GCC=4.8 + # addons: + # apt: + # packages: + # - cmake=2.\* + # - cmake-data=2.\* + # - os: linux + # dist: trusty + # env: PYTHON=3.6 CPP=11 GCC=4.8 + # addons: + # apt: + # sources: + # - deadsnakes + # packages: + # - python3.6-dev + # - python3.6-venv + # - cmake=2.\* + # - cmake-data=2.\* + # - os: linux + # dist: trusty + # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + # addons: + # apt: + # sources: + # - ubuntu-toolchain-r-test + # packages: + # - g++-6 + # - os: linux + # dist: trusty + # # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but + # # seems to have apt conflicts (at least for Trusty). Use Docker instead. + # services: docker + # env: DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + # - os: linux + # dist: xenial + # env: PYTHON=3.6 CPP=17 GCC=7 + # addons: + # apt: + # sources: + # - deadsnakes + # - ubuntu-toolchain-r-test + # packages: + # - g++-7 + # - python3.6-dev + # - python3.6-venv + # - os: linux + # dist: xenial + # env: PYTHON=3.6 CPP=17 CLANG=7 + # addons: + # apt: + # sources: + # - deadsnakes + # - llvm-toolchain-xenial-7 + # packages: + # - python3.6-dev + # - python3.6-venv + # - clang-7 + # - libclang-7-dev + # - llvm-7-dev + # - lld-7 + # - libc++-7-dev + # - libc++abi-7-dev # Why is this necessary??? + # - os: osx + # osx_image: xcode7.3 + # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 + # - os: osx + # osx_image: xcode9 + # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux dist: trusty @@ -118,21 +118,21 @@ matrix: - liblapack-dev - gfortran # Build in 32-bit mode and tests against the CMake-installed version - - os: linux - dist: trusty - services: docker - env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 - script: - - | - set -ex - $SCRIPT_RUN_PREFIX sh -c "set -e - cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . - make install - cp -a tests /pybind11-tests - mkdir /build-tests && cd /build-tests - cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON - make pytest -j 2" - set +ex + # - os: linux + # dist: trusty + # services: docker + # env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 + # script: + # - | + # set -ex + # $SCRIPT_RUN_PREFIX sh -c "set -e + # cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . + # make install + # cp -a tests /pybind11-tests + # mkdir /build-tests && cd /build-tests + # cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON + # make pytest -j 2" + # set +ex cache: directories: - $HOME/.local/bin From 7ba33e5d5ad3bf5b995e75c341a7a189767077f4 Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Wed, 3 Apr 2019 22:15:11 -0400 Subject: [PATCH 33/34] Revert "DNM Only test PyPy" This reverts commit 4702fda3a96e1a14750cb3b4c54b5e6e70d465ab. --- .travis.yml | 230 ++++++++++++++++++++++++++-------------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/.travis.yml b/.travis.yml index cae7a3ac5a..59996bc7e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,106 +7,106 @@ matrix: # - Tests setup.py sdist and install (all header files should be present). # - Makes sure that everything still works without optional deps (numpy/scipy/eigen) and # also tests the automatic discovery functions in CMake (Python version, C++ standard). - # - os: linux - # dist: xenial # Necessary to run doxygen 1.8.15 - # # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead? - # env: STYLE DOCS PIP - # cache: false - # before_install: - # - pyenv global $(pyenv whence 2to3) # activate all python versions - # - PY_CMD=python3 - # - $PY_CMD -m pip install --user --upgrade pip wheel setuptools - # install: # Breathe does not yet support Sphinx 2 - # - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest - # - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - # - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" - # script: - # - tools/check-style.sh - # - flake8 - # - $PY_CMD -m sphinx -W -b html docs docs/.build - # - | - # # Make sure setup.py distributes and installs all the headers - # $PY_CMD setup.py sdist - # $PY_CMD -m pip install --user -U ./dist/* - # installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") - # diff -rq $installed ./include/pybind11 - # - | - # # Barebones build - # cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . - # make pytest -j 2 - # make cpptest -j 2 - # # The following are regular test configurations, including optional dependencies. - # # With regard to each other they differ in Python version, C++ standard and compiler. - # - os: linux - # dist: trusty - # env: PYTHON=2.7 CPP=11 GCC=4.8 - # addons: - # apt: - # packages: - # - cmake=2.\* - # - cmake-data=2.\* - # - os: linux - # dist: trusty - # env: PYTHON=3.6 CPP=11 GCC=4.8 - # addons: - # apt: - # sources: - # - deadsnakes - # packages: - # - python3.6-dev - # - python3.6-venv - # - cmake=2.\* - # - cmake-data=2.\* - # - os: linux - # dist: trusty - # env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 - # addons: - # apt: - # sources: - # - ubuntu-toolchain-r-test - # packages: - # - g++-6 - # - os: linux - # dist: trusty - # # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but - # # seems to have apt conflicts (at least for Trusty). Use Docker instead. - # services: docker - # env: DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 - # - os: linux - # dist: xenial - # env: PYTHON=3.6 CPP=17 GCC=7 - # addons: - # apt: - # sources: - # - deadsnakes - # - ubuntu-toolchain-r-test - # packages: - # - g++-7 - # - python3.6-dev - # - python3.6-venv - # - os: linux - # dist: xenial - # env: PYTHON=3.6 CPP=17 CLANG=7 - # addons: - # apt: - # sources: - # - deadsnakes - # - llvm-toolchain-xenial-7 - # packages: - # - python3.6-dev - # - python3.6-venv - # - clang-7 - # - libclang-7-dev - # - llvm-7-dev - # - lld-7 - # - libc++-7-dev - # - libc++abi-7-dev # Why is this necessary??? - # - os: osx - # osx_image: xcode7.3 - # env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 - # - os: osx - # osx_image: xcode9 - # env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 + - os: linux + dist: xenial # Necessary to run doxygen 1.8.15 + # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead? + env: STYLE DOCS PIP + cache: false + before_install: + - pyenv global $(pyenv whence 2to3) # activate all python versions + - PY_CMD=python3 + - $PY_CMD -m pip install --user --upgrade pip wheel setuptools + install: # Breathe does not yet support Sphinx 2 + - $PY_CMD -m pip install --user --upgrade "sphinx<2" sphinx_rtd_theme breathe flake8 pep8-naming pytest + - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz + - export PATH="$PWD/doxygen-1.8.15/bin:$PATH" + script: + - tools/check-style.sh + - flake8 + - $PY_CMD -m sphinx -W -b html docs docs/.build + - | + # Make sure setup.py distributes and installs all the headers + $PY_CMD setup.py sdist + $PY_CMD -m pip install --user -U ./dist/* + installed=$($PY_CMD -c "import pybind11; print(pybind11.get_include(True) + '/pybind11')") + diff -rq $installed ./include/pybind11 + - | + # Barebones build + cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) . + make pytest -j 2 + make cpptest -j 2 + # The following are regular test configurations, including optional dependencies. + # With regard to each other they differ in Python version, C++ standard and compiler. + - os: linux + dist: trusty + env: PYTHON=2.7 CPP=11 GCC=4.8 + addons: + apt: + packages: + - cmake=2.\* + - cmake-data=2.\* + - os: linux + dist: trusty + env: PYTHON=3.6 CPP=11 GCC=4.8 + addons: + apt: + sources: + - deadsnakes + packages: + - python3.6-dev + - python3.6-venv + - cmake=2.\* + - cmake-data=2.\* + - os: linux + dist: trusty + env: PYTHON=2.7 CPP=14 GCC=6 CMAKE=1 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + - os: linux + dist: trusty + # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but + # seems to have apt conflicts (at least for Trusty). Use Docker instead. + services: docker + env: DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1 + - os: linux + dist: xenial + env: PYTHON=3.6 CPP=17 GCC=7 + addons: + apt: + sources: + - deadsnakes + - ubuntu-toolchain-r-test + packages: + - g++-7 + - python3.6-dev + - python3.6-venv + - os: linux + dist: xenial + env: PYTHON=3.6 CPP=17 CLANG=7 + addons: + apt: + sources: + - deadsnakes + - llvm-toolchain-xenial-7 + packages: + - python3.6-dev + - python3.6-venv + - clang-7 + - libclang-7-dev + - llvm-7-dev + - lld-7 + - libc++-7-dev + - libc++abi-7-dev # Why is this necessary??? + - os: osx + osx_image: xcode7.3 + env: PYTHON=2.7 CPP=14 CLANG CMAKE=1 + - os: osx + osx_image: xcode9 + env: PYTHON=3.7 CPP=14 CLANG DEBUG=1 # Test a PyPy 2.7 build - os: linux dist: trusty @@ -118,21 +118,21 @@ matrix: - liblapack-dev - gfortran # Build in 32-bit mode and tests against the CMake-installed version - # - os: linux - # dist: trusty - # services: docker - # env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 - # script: - # - | - # set -ex - # $SCRIPT_RUN_PREFIX sh -c "set -e - # cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . - # make install - # cp -a tests /pybind11-tests - # mkdir /build-tests && cd /build-tests - # cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON - # make pytest -j 2" - # set +ex + - os: linux + dist: trusty + services: docker + env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 + script: + - | + set -ex + $SCRIPT_RUN_PREFIX sh -c "set -e + cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . + make install + cp -a tests /pybind11-tests + mkdir /build-tests && cd /build-tests + cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON + make pytest -j 2" + set +ex cache: directories: - $HOME/.local/bin From e8580aefa792f19270578d4937dd1c82931875ce Mon Sep 17 00:00:00 2001 From: Eric Cousineau Date: Wed, 3 Apr 2019 22:16:14 -0400 Subject: [PATCH 34/34] Add comments for all builds --- .travis.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59996bc7e2..b2bf4849a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,14 +124,16 @@ matrix: env: DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1 script: - | + # Consolidated 32-bit Docker Build + Install set -ex - $SCRIPT_RUN_PREFIX sh -c "set -e - cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . - make install - cp -a tests /pybind11-tests - mkdir /build-tests && cd /build-tests - cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON - make pytest -j 2" + $SCRIPT_RUN_PREFIX sh -c " + set -ex + cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 . + make install + cp -a tests /pybind11-tests + mkdir /build-tests && cd /build-tests + cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON + make pytest -j 2" set +ex cache: directories: @@ -237,6 +239,7 @@ install: set +ex script: - | + # CMake Configuration set -ex $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} \ -DPYBIND11_PYTHON_VERSION=$PYTHON \ @@ -246,20 +249,24 @@ script: . set +ex - | + # pytest set -ex $SCRIPT_RUN_PREFIX make pytest -j 2 VERBOSE=1 set +ex - | + # cpptest set -ex $SCRIPT_RUN_PREFIX make cpptest -j 2 set +ex - | + # CMake Build Interface set -ex if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi set +ex after_failure: cat tests/test_cmake_build/*.log* after_script: - | + # Cleanup (Docker) set -ex if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi set +ex