Skip to content

Commit

Permalink
Update brew CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed May 2, 2018
1 parent b2107dc commit 3e237af
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
20 changes: 19 additions & 1 deletion .ci/brew/build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ set -ev
export Python=${Python:?}
export WORKSPACE=${WORKSPACE:?}

PYTHON_EXECUTABLE="/usr/local/bin/python${Python}"
PYTHON_PREFIX=$(${PYTHON_EXECUTABLE} -c 'import sys;print(sys.prefix)')
PYTHON_VERSION="$(${PYTHON_EXECUTABLE} -c 'import sys;print(sys.version[:3])')"
PYTHON_VERSION_NO_DOT=$(echo ${PYTHON_VERSION} | sed 's/\.//')
PYTHON_INCLUDE_DIR=$(${PYTHON_EXECUTABLE} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))')
PYTHON_LIBRARY=${PYTHON_PREFIX}/lib/libpython${PYTHON_VERSION}.dylib

if [ "${Python}" = "2" ]
then
Boost_PYTHON_LIBRARY=/usr/local/lib/libboost_python.dylib
else
Boost_PYTHON_LIBRARY=/usr/local/lib/libboost_python${PYTHON_VERSION_NO_DOT}.dylib
fi

mkdir build
mkdir install
cd build
Expand All @@ -13,7 +27,11 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconf

cmake \
-D CMAKE_INSTALL_PREFIX="${WORKSPACE}/install" \
-D PYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
-D PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} \
-D PYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} \
-D PYTHON_LIBRARY=${PYTHON_LIBRARY} \
-D Boost_PYTHON_LIBRARY_DEBUG=${Boost_PYTHON_LIBRARY} \
-D Boost_PYTHON_LIBRARY_RELEASE=${Boost_PYTHON_LIBRARY} \
${CMAKE_OPTIONS} \
..
make ${MAKE_OPTIONS} install
4 changes: 2 additions & 2 deletions .ci/brew/install
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import sys

brew_conflicting = ["json-c"]
brew_required = [
"boost", "boost-python", "cmake", "cppcheck", "dcmtk", "icu4c", "jsoncpp",
"lcov", "log4cpp", "pkg-config", "python"+os.environ["Python"]
"boost", "boost-python", "boost-python3", "cmake", "cppcheck", "dcmtk",
"icu4c", "jsoncpp", "lcov", "log4cpp", "pkg-config", "python", "python@2"
]

pip_required = ["cpp-coveralls", "nose"]
Expand Down
9 changes: 7 additions & 2 deletions .ci/brew/post_build
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ export WORKSPACE=${WORKSPACE:?}

cd build

export PYTHONPATH=${WORKSPACE}/install/$(python${Python} -c "from distutils.sysconfig import *; print(get_python_lib(True, prefix=''))")
../tests/run --no-network --nose ~/Library/Python/${Python}*/bin/nosetests
PYTHON_EXECUTABLE="/usr/local/bin/python${Python}"
PYTHON_VERSION="$(${PYTHON_EXECUTABLE} -c 'import sys;print(sys.version[:3])')"
LOCAL_PYTHON_PREFIX="$(${PYTHON_EXECUTABLE} -c 'from distutils.sysconfig import *; print(get_python_lib(True, prefix=str()))')"

export PYTHONPATH=${WORKSPACE}/install/${LOCAL_PYTHON_PREFIX}
export PATH=~/Library/Python/${PYTHON_VERSION}/bin:${PATH}
../tests/run --no-network --nose nosetests-${PYTHON_VERSION}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ matrix:
sudo: required
dist: trusty
compiler: gcc
env: Architecture=amd64 Distribution=ubuntu/trusty Python=2 WORKSPACE=${TRAVIS_BUILD_DIR} CMAKE_OPTIONS="-D CMAKE_CXX_FLAGS=--coverage" MAKE_OPTIONS="-j$(nproc)"
env: Architecture=amd64 Distribution=ubuntu/trusty Python=3 WORKSPACE=${TRAVIS_BUILD_DIR} CMAKE_OPTIONS="-D CMAKE_CXX_FLAGS=--coverage" MAKE_OPTIONS="-j$(nproc)"
- os: osx
compiler: clang
env: Python=2 WORKSPACE=${TRAVIS_BUILD_DIR} MAKE_OPTIONS="-j$(sysctl -n hw.ncpu)"
env: Python=3 WORKSPACE=${TRAVIS_BUILD_DIR} MAKE_OPTIONS="-j$(sysctl -n hw.ncpu)"
install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo -E sh ./.ci/deb/install; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./.ci/brew/install; fi
Expand Down
2 changes: 1 addition & 1 deletion wrappers/python/Association.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ float get_tcp_timeout(odil::Association const& association)
void set_tcp_timeout(odil::Association& association, float seconds)
{
association.set_tcp_timeout(
boost::posix_time::microseconds(seconds*1000000.));
boost::posix_time::microseconds(int(seconds*1000000.)));
}

}
Expand Down

0 comments on commit 3e237af

Please sign in to comment.