sudo: required language: python python: - "2.7" - "3.5" before_install: - git clone -q --branch=master https://github.com/Itseez/opencv.git opencv - python find_version.py > tmp - opencv_version=$(cat tmp) - rm tmp - echo $opencv_version install: - sudo add-apt-repository ppa:kalakris/cmake -y - sudo apt-get update -qq - sudo apt-get install cmake - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then sudo apt-get install python2.7-dev; fi - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo add-apt-repository ppa:fkrull/deadsnakes -y && sudo apt-get update -qq; fi - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo apt-get install libpython3.5-dev; fi - python -m pip install --upgrade pip - pip install -r requirements.txt - cd opencv - mkdir build - whereis python - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_python3=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DPYTHON_EXECUTABLE=$(which python) -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -Wno-dev; fi - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DPYTHON3_EXECUTABLE=$(which python) -DPYTHON3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so -DPYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -Wno-dev; fi - cd build - cmake --build . --config Release - cd ../.. - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then cp opencv/build/lib/*.so cv2; fi - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then cp opencv/build/lib/python3/*.so cv2; fi - python setup.py bdist_wheel --opencv-version "$opencv_version-$TRAVIS_BUILD_NUMBER" before_script: - pip install --no-index --find-links=dist/ opencv-python script: - cd tests - python -m unittest test