Skip to content
Snippets Groups Projects
Verified Commit 3eba23f1 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

travis: fix Python search

parent 9f0d17ca
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,9 @@ script: ...@@ -75,7 +75,9 @@ script:
- mkdir build - mkdir build
- cd build - cd build
- export CMAKE_PREFIX_PATH=/tmp/_ci/install - export CMAKE_PREFIX_PATH=/tmp/_ci/install
- 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'))") - export PYTHON_DEFAULT_VERSION=$(which python2)
- if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then export PYTHON_DEFAULT_VERSION=$(which python3); fi
- cmake .. -DPYTHON_EXECUTABLE=$PYTHON_DEFAULT_VERSION
- make - make
- ./extra_lib - ./extra_lib
- cd /tmp/_ci/build - cd /tmp/_ci/build
......
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
# Add Python dependency # Add Python dependency
echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION" echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"
export PYTHON_DEFAULT_VERSION=$(which python2)
if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then if [[ $TRAVIS_PYTHON_VERSION -gt 30 ]]; then
export APT_DEPENDENCIES=$APT_DEPENDENCIES" python3-numpy" export APT_DEPENDENCIES=$APT_DEPENDENCIES" python3-numpy"
export PYTHON_DEFAULT_VERSION=$(which python3)
fi fi
# When this script is called the current directory is ./custom_travis # When this script is called the current directory is ./custom_travis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment