From 922e5c28441487105264cb1c52855ca20eaedc06 Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Thu, 20 Feb 2020 12:53:20 +0100
Subject: [PATCH] travis: fix numpy for Python3

---
 .travis.yml                         |  3 +--
 travis_custom/custom_before_install | 14 ++++++++++++++
 travis_custom/custom_build          |  1 -
 3 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100755 travis_custom/custom_before_install

diff --git a/.travis.yml b/.travis.yml
index 3039d8e8..3d4d7437 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,6 @@ env:
     - DO_COVERAGE_ON_BRANCH="master;release"
     - DO_CPPCHECK_ON_BRANCH=""
     - DO_INSTALL_DOC_EXCEPT_ON_BRANCH=""
-    - BUILD_WITH_CATKIN_SUPPORT=false
     - MAKEFLAGS="-j2"
 
 jobs:
@@ -67,7 +66,7 @@ branches:
     - master
     - debian
     - devel
-before_install: ./.travis/run before_install
+before_install: ./travis_custom/custom_before_install
 install: pip install coveralls numpy --user
 script:
   - export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE}"
diff --git a/travis_custom/custom_before_install b/travis_custom/custom_before_install
new file mode 100755
index 00000000..9fbf67f3
--- /dev/null
+++ b/travis_custom/custom_before_install
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Add Python dependency
+echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"
+if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then
+  export APT_DEPENDENCIES=$APT_DEPENDENCIES" python3-numpy"
+fi
+
+# When this script is called the current directory is ./custom_travis
+. ./.travis/run ../.travis/before_install
+
+# Git fetch tags
+git fetch --tags
+
diff --git a/travis_custom/custom_build b/travis_custom/custom_build
index 4c3cf67e..9874b089 100755
--- a/travis_custom/custom_build
+++ b/travis_custom/custom_build
@@ -11,7 +11,6 @@ fi
 
 if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then
   export CMAKE_ADDITIONAL_OPTIONS=" ${CMAKE_ADDITIONAL_OPTIONS} -DPYTHON_EXECUTABLE=$(which python3)"
-  pip3 install numpy --user
 fi
 
 # Setup environment variables.
-- 
GitLab