.travis.yml 2.0 KB
Newer Older
1 2
sudo: required

3 4 5 6 7 8 9
language: python

python:
  - "2.7"
  - "3.5"

before_install:
10
  - git clone -q --branch=master https://github.com/Itseez/opencv.git opencv
11 12 13 14 15 16
  - python find_version.py > tmp 
  - opencv_version=$(cat tmp)
  - rm tmp
  - echo $opencv_version

install: 
17 18
  - sudo apt-get install cmake
  - sudo add-apt-repository ppa:fkrull/deadsnakes
19 20
  - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then sudo apt-get install python2.7-dev; fi
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo apt-get install python3.5-dev; fi
21 22
  - python -m pip install --upgrade pip
  - pip install -r requirements.txt
23
  - cd opencv
24
  - mkdir build
25 26 27
  - whereis python
  - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_python3=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DPYTHON2_EXECUTABLE=${VIRTUAL_ENV}/bin/python -DPYTHON2_LIBRARY=/usr/lib/libpython2.7mu.so -DPYTHON2_INCLUDE_DIR=/usr/include/python2.7m -DPYTHON2_PACKAGES_PATH=${VIRTUAL_ENV}/lib/python2.7/site-packages -Wno-dev; fi
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_python2=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DPYTHON3_EXECUTABLE=${VIRTUAL_ENV}/bin/python -DPYTHON3_LIBRARY=/usr/lib/libpython3.5mu.so -DPYTHON3_INCLUDE_DIR=/usr/include/python3.5m -DPYTHON3_PACKAGES_PATH=${VIRTUAL_ENV}/lib/python3.5/site-packages -Wno-dev; fi
28 29 30 31 32 33 34 35 36 37 38 39
  - cd build 
  - cmake --build . --config Release
  - cd ../..
  - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then cp opencv\build\lib\RELEASE\*.pyd opencv-python/cv2; fi
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then cp opencv\build\lib\python3\Release\*.pyd opencv-python/cv2; fi
  - python setup.py bdist_wheel --opencv-version "$opencv_version-$TRAVIS_BUILD_NUMBER"

before_script:
  - pip install --no-index --find-links=opencv-python\dist\ opencv-python

script:
  - cd tests
40
  - python -m unittest test