Skip to content

Commit 3eba23f

Browse files
committed
travis: fix Python search
1 parent 9f0d17c commit 3eba23f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ script:
7575
- mkdir build
7676
- cd build
7777
- export CMAKE_PREFIX_PATH=/tmp/_ci/install
78-
- cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION -DPYTHON_INCLUDE_DIR=$($PYTHON_DEFAULT_VERSION -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_LIBRARY=$($PYTHON_DEFAULT_VERSION -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
78+
- export PYTHON_DEFAULT_VERSION=$(which python2)
79+
- if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then export PYTHON_DEFAULT_VERSION=$(which python3); fi
80+
- cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION
7981
- make
8082
- ./extra_lib
8183
- cd /tmp/_ci/build

travis_custom/custom_before_install

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
# Add Python dependency
44
echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"
5-
export PYTHON_DEFAULT_VERSION=$(which python2)
65
if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then
76
export APT_DEPENDENCIES=$APT_DEPENDENCIES" python3-numpy"
8-
export PYTHON_DEFAULT_VERSION=$(which python3)
97
fi
108

119
# When this script is called the current directory is ./custom_travis

0 commit comments

Comments
 (0)