Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 5 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,14 @@ services: docker

matrix:
include:
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- os: linux
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686

actual-matrix:
include:
- os: linux
env:
- MB_PYTHON_VERSION=2.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- os: linux
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=2.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- MB_PYTHON_VERSION=3.4
- os: linux
env:
- MB_PYTHON_VERSION=2.7
Expand Down Expand Up @@ -98,18 +85,6 @@ actual-matrix:
- MB_PYTHON_VERSION=3.5
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=2.7
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.4
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.5

before_install:
- source multibuild/common_utils.sh
Expand All @@ -120,7 +95,6 @@ install:
# Maybe get and clean and patch source
- clean_code $REPO_DIR $BUILD_COMMIT
- travis_wait 120 build_wheel $REPO_DIR $PLAT
# - build_wheel $REPO_DIR $PLAT

script:
- install_run $PLAT
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
environment:
environment:
USER:
secure: fXgF9uyy6sT0JoVOR7BoqA==

Expand Down Expand Up @@ -109,4 +109,3 @@ artifacts:

deploy_script:
- if "%APPVEYOR_REPO_TAG%"=="true" (twine -u %USER% -p %PASS% -r pypitest dist/*) else (echo "Tag not set, deployment skipped.")

34 changes: 29 additions & 5 deletions config.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Define custom utilities
# Test for OSX with [ -n "$IS_OSX" ]
#!/bin/bash
set +e
echo "=== Loading config.sh === "
if [ -n "$IS_OSX" ]; then
echo " > OSX environment "
function build_wheel {
# Custom build_wheel function for OSX
# Run using '.' instead of '$REPO_DIR' to build from
# opencv-python instead of opencv
build_pip_wheel . $@
}
else
echo " > Linux environment "
fi

function pre_build {
echo "Starting pre-build"

set +e
if [ -n "$IS_OSX" ]; then
echo "Don't know how to build for OSX yet..."
# source travis/build-wheels-osx.sh
echo "Running for OSX"
source travis/build-wheels-osx.sh
else
echo "Running for linux"
source /io/travis/build-wheels.sh
Expand All @@ -17,8 +30,19 @@ function run_tests {
# Runs tests on installed distribution from an empty directory
# python --version
# python -c 'import sys; import yourpackage; sys.exit(yourpackage.test())'
set +e
echo "Run tests..."
echo $PWD
ls -lh
source /io/travis/test-wheels.sh

if [ -n "$IS_OSX" ]; then
echo "Dont know how to test for OSX yet..."
cd ../tests/
source ../travis/test-wheels.sh
else
echo "Running for linux"
apt-get -y install libglib2.0-0
cd /io/tests/
source /io/travis/test-wheels.sh
fi
}
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def is_pure(self):
distclass=BinaryDistribution,
packages=['cv2'],
package_data=package_data,
maintainer="Olli-Pekka Heinisuo",
include_package_data=True,
maintainer="Olli-Pekka Heinisuo",
include_package_data=True,
install_requires="numpy==%s" % numpy_version,
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -66,4 +66,4 @@ def is_pure(self):
'Topic :: Scientific/Engineering :: Image Recognition',
'Topic :: Software Development',
]
)
)
72 changes: 71 additions & 1 deletion travis/build-wheels-osx.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,79 @@
#!/bin/bash
pip install numpy
set +e
echo 'Begin build-wheel OSX ...'

export PYTHON_VERSION=${MB_PYTHON_VERSION/./}
echo 'MB_PYTHON_VERSION: 'MB_PYTHON_VERSION
echo 'PYTHON_VERSION: '$PYTHON_VERSION

echo 'PIP and brew installs'

brew install cmake pkg-config
brew install jpeg libpng libtiff openexr
brew install eigen tbb

if [[ $PYTHON_VERSION == 3* ]]; then
brew install python3
pip3 install numpy
fi

if [[ $PYTHON_VERSION == 2* ]]; then
pip install numpy
fi

echo 'Begin our build'
ls -lh

python ./find_version.py
pip install -r requirements.txt

echo 'Config make'

cd opencv
mkdir build
cd build

if [[ $PYTHON_VERSION == 2* ]]; then
echo 'Config for Py2'
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF \
-D PYTHON2_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin \
-D PYTHON2_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF ..
fi

if [[ $PYTHON_VERSION == 3* ]]; then
echo 'Config for Py3'
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF \
-D PYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/bin \
-D PYTHON3_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF ..
fi

echo 'Begin build'
make -j4

# Moving back to opencv-python
cd ../..

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

if [[ $PYTHON_VERSION == 3* ]]; then
echo 'Copying *.so for Py3'
cp opencv/build/lib/python3/*.so cv2/
fi

echo 'Build wheel'
# pip wheel . -w ./wheelhouse/

echo 'Cleanup'
# rm -fr opencv/build
# rm cv2/*.so
4 changes: 1 addition & 3 deletions travis/test-wheels.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash

PYTHON=python$PYTHON_VERSION
echo "Starting tests..."
apt-get -y install libglib2.0-0

cd /io/tests/
echo "Starting tests..."

#Test package
$PYTHON -m unittest test