.travis.yml 2.3 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 add-apt-repository ppa:kalakris/cmake -y
  - sudo apt-get update -qq
19
  - sudo apt-get install cmake
20
  - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then sudo apt-get install python2.7-dev; fi
21
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo add-apt-repository ppa:fkrull/deadsnakes -y && sudo apt-get update -qq; fi
22
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo apt-get install libpython3.5-dev; fi
23 24
  - python -m pip install --upgrade pip
  - pip install -r requirements.txt
25
  - cd opencv
26
  - mkdir build
27
  - whereis python
28
  - 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
29
  - 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
30 31 32
  - cd build 
  - cmake --build . --config Release
  - cd ../..
33
  - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then cp opencv/build/lib/*.so cv2; fi
34
  - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then cp opencv/build/lib/python3/*.so cv2; fi
35 36 37
  - python setup.py bdist_wheel --opencv-version "$opencv_version-$TRAVIS_BUILD_NUMBER"

before_script:
O
Olli-Pekka Heinisuo 已提交
38
  - pip install --no-index --find-links=dist/ opencv-python
39 40 41

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