Skip to content

Commit 3defe68

Browse files
committed
Fix conflicts
1 parent c1bb4d2 commit 3defe68

File tree

8 files changed

+231
-84
lines changed

8 files changed

+231
-84
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "opencv"]
2+
path = opencv
3+
url = https://github.com/Itseez/opencv.git
4+
[submodule "multibuild"]
5+
path = multibuild
6+
url = https://github.com/matthew-brett/multibuild.git

.travis.yml

Lines changed: 129 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,137 @@
1-
notifications:
2-
email: false
1+
env:
2+
global:
3+
- REPO_DIR=opencv
4+
# Commit from opencv that you want to build
5+
- BUILD_COMMIT=master
6+
# pip dependencies to _build_ your project
7+
- BUILD_DEPENDS="Cython numpy"
8+
# pip dependencies to _test_ your project. Include any dependencies
9+
# that you need, that are also specified in BUILD_DEPENDS, this will be
10+
# a separate install.
11+
- TEST_DEPENDS="numpy scipy pytest"
12+
- PLAT=x86_64
13+
- UNICODE_WIDTH=32
14+
- WHEELHOUSE_UPLOADER_USERNAME=travis-worker
15+
# Following generated with
16+
# travis encrypt -r your-org/your-project-wheels WHEELHOUSE_UPLOADER_SECRET=<the api key>
17+
# This is for Rackspace uploads. Contact Matthew Brett, or the
18+
# scikit-learn team, for # permission (and the API key) to upload to
19+
# the Rackspace account used here, or use your own account.
20+
#- secure:
21+
# "MNKyBWOzu7JAUmC0Y+JhPKfytXxY/ADRmUIMEWZV977FLZPgYctqd+lqel2QIFgdHDO1CIdTSymOOFZckM9ICUXg9Ta+8oBjSvAVWO1ahDcToRM2DLq66fKg+NKimd2OfK7x597h/QmUSl4k8XyvyyXgl5jOiLg/EJxNE2r83IA="
22+
23+
language: python
24+
# The travis Python version is unrelated to the version we build and test
25+
# with. This is set with the MB_PYTHON_VERSION variable.
26+
python: 3.5
27+
sudo: required
28+
dist: trusty
29+
services: docker
330

431
matrix:
532
include:
6-
- sudo: required
7-
services:
8-
- docker
9-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
10-
PYTHON_VERSION=26
11-
- sudo: required
12-
services:
13-
- docker
14-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
15-
PYTHON_VERSION=27
16-
- sudo: required
17-
services:
18-
- docker
19-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
20-
PYTHON_VERSION=33
21-
- sudo: required
22-
services:
23-
- docker
24-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
25-
PYTHON_VERSION=34
26-
- sudo: required
27-
services:
28-
- docker
29-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
30-
PYTHON_VERSION=35
33+
- os: linux
34+
env:
35+
- MB_PYTHON_VERSION=2.7
36+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
37+
- os: linux
38+
env:
39+
- MB_PYTHON_VERSION=2.7
40+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
41+
- PLAT=i686
42+
43+
actual-matrix:
44+
include:
45+
- os: linux
46+
env:
47+
- MB_PYTHON_VERSION=2.6
48+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
49+
- os: linux
50+
env:
51+
- MB_PYTHON_VERSION=2.6
52+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
53+
- PLAT=i686
54+
- os: linux
55+
env:
56+
- MB_PYTHON_VERSION=2.7
57+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
58+
- os: linux
59+
env:
60+
- MB_PYTHON_VERSION=2.7
61+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
62+
- UNICODE_WIDTH=16
63+
- os: linux
64+
env:
65+
- MB_PYTHON_VERSION=2.7
66+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
67+
- PLAT=i686
68+
- os: linux
69+
env:
70+
- MB_PYTHON_VERSION=2.7
71+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
72+
- PLAT=i686
73+
- UNICODE_WIDTH=16
74+
- os: linux
75+
env:
76+
- MB_PYTHON_VERSION=3.3
77+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
78+
- os: linux
79+
env:
80+
- MB_PYTHON_VERSION=3.3
81+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
82+
- PLAT=i686
83+
- os: linux
84+
env:
85+
- MB_PYTHON_VERSION=3.4
86+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
87+
- os: linux
88+
env:
89+
- MB_PYTHON_VERSION=3.4
90+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
91+
- PLAT=i686
92+
- os: linux
93+
env:
94+
- MB_PYTHON_VERSION=3.5
95+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
96+
- os: linux
97+
env:
98+
- MB_PYTHON_VERSION=3.5
99+
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
100+
- PLAT=i686
101+
- os: osx
102+
language: generic
103+
env:
104+
- MB_PYTHON_VERSION=2.7
105+
- os: osx
106+
language: generic
107+
env:
108+
- MB_PYTHON_VERSION=3.4
109+
- os: osx
110+
language: generic
111+
env:
112+
- MB_PYTHON_VERSION=3.5
31113

32-
- sudo: required
33-
services:
34-
- docker
35-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
36-
PRE_CMD=linux32
37-
PYTHON_VERSION=26
38-
- sudo: required
39-
services:
40-
- docker
41-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
42-
PRE_CMD=linux32
43-
PYTHON_VERSION=27
44-
- sudo: required
45-
services:
46-
- docker
47-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
48-
PRE_CMD=linux32
49-
PYTHON_VERSION=33
50-
- sudo: required
51-
services:
52-
- docker
53-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
54-
PRE_CMD=linux32
55-
PYTHON_VERSION=34
56-
- sudo: required
57-
services:
58-
- docker
59-
env: DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
60-
PRE_CMD=linux32
61-
PYTHON_VERSION=35
114+
before_install:
115+
- source multibuild/common_utils.sh
116+
- source multibuild/travis_steps.sh
117+
- before_install
62118

63119
install:
64-
- docker pull $DOCKER_IMAGE
120+
# Maybe get and clean and patch source
121+
- clean_code $REPO_DIR $BUILD_COMMIT
122+
- travis_wait 120 build_wheel $REPO_DIR $PLAT
123+
# - build_wheel $REPO_DIR $PLAT
65124

66125
script:
67-
- docker run --rm -v `pwd`:/io -e PYTHON_VERSION=$PYTHON_VERSION $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
68-
- ls wheelhouse/
126+
- install_run $PLAT
127+
128+
after_success:
129+
# Upload wheels to Rackspace container
130+
- pip install wheelhouse-uploader
131+
# This uploads the wheels to a Rackspace container owned by the
132+
# scikit-learn team, available at http://wheels.scipy.org. See above
133+
# for information on using this account or choosing another.
134+
- python -m wheelhouse_uploader upload --local-folder
135+
${TRAVIS_BUILD_DIR}/wheelhouse/
136+
--no-update-index
137+
wheels

config.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Define custom utilities
2+
# Test for OSX with [ -n "$IS_OSX" ]
3+
4+
function pre_build {
5+
echo "Starting pre-build"
6+
7+
if [ -n "$IS_OSX" ]; then
8+
echo "Don't know how to build for OSX yet..."
9+
# source travis/build-wheels-osx.sh
10+
else
11+
echo "Running for linux"
12+
source /io/travis/build-wheels.sh
13+
fi
14+
}
15+
16+
function run_tests {
17+
# Runs tests on installed distribution from an empty directory
18+
# python --version
19+
# python -c 'import sys; import yourpackage; sys.exit(yourpackage.test())'
20+
echo "Run tests..."
21+
echo $PWD
22+
ls -lh
23+
source /io/travis/test-wheels.sh
24+
}

multibuild

Submodule multibuild added at 7abbd01

opencv

Submodule opencv added at b34272f

travis/build-wheels-osx.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
pip install numpy
3+
brew install cmake pkg-config
4+
brew install jpeg libpng libtiff openexr
5+
brew install eigen tbb
6+
7+
cd opencv
8+
mkdir build
9+
cd build

travis/build-wheels.sh

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,79 @@
11
#!/bin/bash
2-
2+
set +e
3+
echo 'Begin build-wheel...'
34
/opt/_internal/cpython-3.5.1/bin/pip3.5 install --upgrade git+git://github.com/pypa/auditwheel
45

5-
cd /io
6-
git clone -q --branch=python-wheel https://github.com/c-martinez/opencv.git opencv
6+
export PYTHON_VERSION=${PYTHON_VERSION/./}
7+
8+
echo 'PYTHON_VERSION: '$PYTHON_VERSION
79

810
for PYBIN in /opt/python/cp$PYTHON_VERSION*/bin; do
9-
$PYBIN/python find_version.py
11+
echo 'PWD : '$PWD
12+
echo 'PYBIN: '$PYBIN
13+
14+
$PYBIN/python ./find_version.py
1015
$PYBIN/pip install -r requirements.txt
1116

1217
# Begin build
18+
echo 'Begin build'
1319
cd opencv
1420
mkdir build
1521
if [[ $PYTHON_VERSION == 2* ]]; then
16-
cmake28 -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=$PYBIN/python -DPYTHON_INCLUDE_DIR=$($PYBIN/python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -Wno-dev;
22+
echo 'Config for Py2'
23+
cmake28 -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
24+
-DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_IPP=OFF \
25+
-DPYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
26+
-DPYTHON2_EXECUTABLE=$PYBIN/python \
27+
-DPYTHON2_VERSION_STRING=$($PYBIN/python -c "from platform import python_version; print python_version()") \
28+
-DPYTHON2_INCLUDE_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
29+
-DPYTHON2_PACKAGES_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
30+
-DPYTHON2_NUMPY_INCLUDE_DIRS=$($PYBIN/python -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))") \
31+
-DPYTHON2_NUMPY_VERSION=$($PYBIN/python -c "import numpy; print(numpy.version.version)")
1732
fi
1833

1934
if [[ $PYTHON_VERSION == 3* ]]; then
20-
cmake28 -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=$PYBIN/python -DPYTHON_INCLUDE_DIR=$($PYBIN/python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_PACKAGES_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -Wno-dev;
35+
echo 'Config for Py3'
36+
cmake28 -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
37+
-DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_IPP=OFF \
38+
-DPYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
39+
-DPYTHON3_EXECUTABLE=$PYBIN/python \
40+
-DPYTHON3_VERSION_STRING=$($PYBIN/python -c "from platform import python_version; print python_version()") \
41+
-DPYTHON3_INCLUDE_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
42+
-DPYTHON3_PACKAGES_PATH=$($PYBIN/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
43+
-DPYTHON3_NUMPY_INCLUDE_DIRS=$($PYBIN/python -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))") \
44+
-DPYTHON3_NUMPY_VERSION=$($PYBIN/python -c "import numpy; print(numpy.version.version)")
45+
fi
46+
47+
if [[ $PYTHON_VERSION == 2* ]]; then
48+
echo 'Build for Py2'
49+
(cd build; make -j5 opencv_python2)
2150
fi
2251

23-
# DO BUILD
24-
cd build
25-
cmake28 --build . --config Release
26-
cd ../..
52+
if [[ $PYTHON_VERSION == 3* ]]; then
53+
echo 'Build for Py3'
54+
(cd build; make -j5 opencv_python3)
55+
fi
56+
57+
58+
# Moving back to opencv-python
59+
cd ..
2760

2861
if [[ $PYTHON_VERSION == 2* ]]; then
62+
echo 'Copying *.so for Py2'
2963
cp opencv/build/lib/cv2.so cv2/
3064
fi
3165

3266
if [[ $PYTHON_VERSION == 3* ]]; then
67+
echo 'Copying *.so for Py3'
3368
cp opencv/build/lib/python3/*.so cv2/
3469
fi
35-
rm -fr opencv/build
3670

3771
# Build wheel
38-
$PYBIN/pip wheel . -w tmpwheels/
39-
done
72+
echo 'Build wheel'
73+
$PYBIN/pip wheel . -w /io/wheelhouse/
4074

41-
# Bundle external shared libraries into the wheels
42-
for whl in tmpwheels/opencv*.whl; do
43-
auditwheel repair $whl -w /io/wheelhouse/
44-
done
45-
rm -fr tmpwheels/
46-
47-
cd tests
48-
# Install packages and test
49-
for PYBIN in /opt/python/cp$PYTHON_VERSION*/bin/; do
50-
$PYBIN/pip install opencv-python --no-index -f /io/wheelhouse
51-
$PYBIN/python -m unittest test
75+
# Cleanup
76+
echo 'Cleanup'
77+
rm -fr opencv/build
78+
rm cv2/*.so
5279
done

travis/test-wheels.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
PYTHON=python$PYTHON_VERSION
4+
echo "Starting tests..."
5+
apt-get -y install libglib2.0-0
6+
7+
cd /io/tests/
8+
9+
#Test package
10+
$PYTHON -m unittest test

0 commit comments

Comments
 (0)