-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis tweaks to make sure the correct versions of python are install…
…ed (onnx#584) * Revert "Revert "osx travis support (onnx#566)"" This reverts commit 9621872. * travis tweaks to make sure the correct versions of python are installed
- Loading branch information
1 parent
a711252
commit 4e9d21b
Showing
8 changed files
with
134 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,62 @@ | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.6" | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- dos2unix | ||
language: generic | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
sudo: required | ||
env: PYTHON_VERSION=python2 | ||
language: python | ||
python: "2.7" | ||
- os: linux | ||
sudo: required | ||
env: PYTHON_VERSION=python3 | ||
language: python | ||
python: "3.6" | ||
- os: osx | ||
osx_image: xcode9.3beta | ||
env: PYTHON_VERSION=python2 | ||
- os: osx | ||
osx_image: xcode9.3beta | ||
env: PYTHON_VERSION=python3 | ||
- os: linux | ||
sudo: required | ||
env: PYTHON_VERSION=python2 ONNX_ML=1 | ||
language: python | ||
python: "2.7" | ||
- os: linux | ||
sudo: required | ||
env: PYTHON_VERSION=python3 ONNX_ML=1 | ||
language: python | ||
python: "3.6" | ||
- os: osx | ||
osx_image: xcode9.3beta | ||
env: PYTHON_VERSION=python2 ONNX_ML=1 | ||
- os: osx | ||
osx_image: xcode9.3beta | ||
env: PYTHON_VERSION=python3 ONNX_ML=1 | ||
|
||
env: | ||
global: | ||
- PB_VERSION=2.6.1 | ||
|
||
before_install: | ||
- ./.travis/before_install.sh | ||
|
||
install: | ||
- ./.travis/install.sh | ||
|
||
script: | ||
- ./.travis/build.sh | ||
- ./.travis/script.sh | ||
|
||
after_success: | ||
- ./.travis/after_success.sh | ||
|
||
after_failure: | ||
- ./.travis/after_failure.sh | ||
|
||
cache: | ||
- timeout: 300 | ||
- directories: | ||
- $HOME/.build_cache | ||
- $BUILD_CCACHE_DIR | ||
- $HOME/.ccache | ||
|
||
env: | ||
global: | ||
- PB_VERSION=2.6.1 | ||
matrix: | ||
- USE_NINJA=false | ||
- USE_NINJA=true | ||
- ONNX_ML=1 USE_NINJA=false | ||
- ONNX_ML=1 USE_NINJA=true | ||
- $HOME/.cache/pb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
script_path=$(python -c "import os; import sys; print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}") | ||
source "${script_path%/*}/setup.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
script_path=$(python -c "import os; import sys; print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}") | ||
source "${script_path%/*}/setup.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# Don't source setup.sh here, because the virtualenv might not be set up yet | ||
|
||
export NUMCORES=`grep -c ^processor /proc/cpuinfo` | ||
if [ ! -n "$NUMCORES" ]; then | ||
export NUMCORES=`sysctl -n hw.ncpu` | ||
fi | ||
echo Using $NUMCORES cores | ||
|
||
# Install dependencies | ||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
sudo apt-get update | ||
APT_INSTALL_CMD='sudo apt-get install -y --no-install-recommends' | ||
$APT_INSTALL_CMD dos2unix | ||
|
||
function install_protobuf() { | ||
# Install protobuf | ||
pb_dir="~/.cache/pb" | ||
mkdir -p "$pb_dir" | ||
wget -qO- "https://github.com/google/protobuf/releases/download/v${PB_VERSION}/protobuf-${PB_VERSION}.tar.gz" | tar -xz -C "$pb_dir" --strip-components 1 | ||
ccache -z | ||
cd "$pb_dir" && ./configure && make -j${NUMCORES} && make check && sudo make install && sudo ldconfig | ||
ccache -s | ||
} | ||
|
||
install_protobuf | ||
|
||
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
brew install ccache protobuf | ||
if [ "${PYTHON_VERSION}" == "python3" ]; then | ||
brew upgrade python | ||
fi | ||
else | ||
echo Unknown OS: $TRAVIS_OS_NAME | ||
exit 1 | ||
fi | ||
|
||
# TODO consider using "python3.6 -m venv" | ||
# which is recommended by python3.6 and may make some difference | ||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
pip install virtualenv | ||
virtualenv -p "${PYTHON_VERSION}" "${HOME}/virtualenv" | ||
source "${HOME}/virtualenv/bin/activate" | ||
fi | ||
|
||
# Update all existing python packages | ||
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U | ||
|
||
pip install pytest-cov nbval |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
#!/bin/bash | ||
|
||
scripts_dir=$(dirname $(readlink -e "${BASH_SOURCE[0]}")) | ||
source "$scripts_dir/common" | ||
script_path=$(python -c "import os; import sys; print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}") | ||
source "${script_path%/*}/setup.sh" | ||
|
||
# install protobuf | ||
pb_dir="$build_cache_dir/pb" | ||
mkdir -p $pb_dir | ||
wget -qO- "https://github.com/google/protobuf/releases/download/v$PB_VERSION/protobuf-$PB_VERSION.tar.gz" | tar -xvz -C "$pb_dir" --strip-components 1 | ||
ccache -z | ||
cd "$pb_dir" && ./configure && make && make check && sudo make install && sudo ldconfig | ||
ccache -s | ||
|
||
|
||
if [[ $USE_NINJA == true ]]; then | ||
pip install ninja | ||
fi | ||
time ONNX_NAMESPACE=ONNX_NAMESPACE_FOO_BAR_FOR_CI pip install -v . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set -ex | ||
|
||
export top_dir=$(dirname ${0%/*}) | ||
|
||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
source "${HOME}/virtualenv/bin/activate" | ||
fi | ||
|
||
# setup ccache | ||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
export PATH="/usr/lib/ccache:$PATH" | ||
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
export PATH="/usr/local/opt/ccache/libexec:$PATH" | ||
else | ||
echo Unknown OS: $TRAVIS_OS_NAME | ||
exit 1 | ||
fi | ||
ccache --max-size 1G |