diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d7c5580a80..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,83 +0,0 @@ -language: generic - -matrix: - include: - - os: linux - sudo: required - env: PYTHON_VERSION=python2 ONNX_ML=0 - language: python - python: "2.7" - - os: linux - sudo: required - env: PYTHON_VERSION=python3 ONNX_ML=0 - language: python - python: "3.6" - - os: linux - sudo: required - env: PYTHON_VERSION=python3 ONNX_ML=0 ONNX_DEBUG=1 - language: python - python: "3.6" - - os: linux - sudo: required - env: PYTHON_VERSION=python3 ONNX_ML=1 ONNX_DEBUG=1 - language: python - python: "3.6" - - os: osx - osx_image: xcode9.3 - env: PYTHON_VERSION=python2 ONNX_ML=0 - - os: osx - osx_image: xcode9.3 - env: PYTHON_VERSION=python3 ONNX_ML=0 - - 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.3 - env: PYTHON_VERSION=python2 - - os: osx - osx_image: xcode9.3 - env: PYTHON_VERSION=python3 - - os: osx - osx_image: xcode9.3 - env: PYTHON_VERSION=python3 ONNX_DEBUG=1 - - os: linux - sudo: required - env: PYTHON_VERSION=python2 LITE=1 - language: python - python: "2.7" - - os: osx - osx_image: xcode9.3 - env: PYTHON_VERSION=python2 LITE=1 - -env: - global: - - PB_VERSION=2.6.1 - -before_install: - - ./.travis/before_install.sh - -install: - - ./.travis/install.sh - -script: - - ./.travis/script.sh - -after_success: - - ./.travis/after_success.sh - -after_failure: - - ./.travis/after_failure.sh - -cache: - - timeout: 300 - - directories: - - $BUILD_CCACHE_DIR - - $HOME/.ccache - - $HOME/.cache/pb diff --git a/.travis/after_failure.sh b/.travis/after_failure.sh deleted file mode 100755 index 3a22393faf1..00000000000 --- a/.travis/after_failure.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/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" diff --git a/.travis/after_success.sh b/.travis/after_success.sh deleted file mode 100755 index 3a22393faf1..00000000000 --- a/.travis/after_success.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/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" diff --git a/.travis/before_install.sh b/.travis/before_install.sh deleted file mode 100755 index 3dad9110adb..00000000000 --- a/.travis/before_install.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# Don't source setup.sh here, because the virtualenv might not be set up yet - -set -o xtrace - -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 - local pb_dir="$HOME/.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 && cd - - ccache -s - } - - install_protobuf - -elif [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update - brew install ccache protobuf - if [ "${PYTHON_VERSION}" == "python3" ]; then - # For mypy, if you want to target the latest Python version, you will have to use that latest version to run mypy - # Therefore, if travis-ci need to test 3.8 in the future, it will need to install py3.8 here - # Simply install python@3.6.5 for now - brew unlink python - brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb - 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 --quiet virtualenv - virtualenv -p "${PYTHON_VERSION}" "${HOME}/virtualenv" - source "${HOME}/virtualenv/bin/activate" -fi - -# Update all existing python packages -pip install --quiet -U pip setuptools - -pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U --quiet diff --git a/.travis/install.sh b/.travis/install.sh deleted file mode 100755 index edfc75db787..00000000000 --- a/.travis/install.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/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" - -export ONNX_BUILD_TESTS=1 -pip install --quiet protobuf numpy - -export CMAKE_ARGS="-DONNX_WERROR=ON" -if [[ -n "USE_LITE_PROTO" ]]; then - export CMAKE_ARGS="${CMAKE_ARGS} -DONNX_USE_LITE_PROTO=ON" -fi -export CMAKE_ARGS="${CMAKE_ARGS} -DONNXIFI_DUMMY_BACKEND=ON" -export ONNX_NAMESPACE=ONNX_NAMESPACE_FOO_BAR_FOR_CI - -if [ "${ONNX_DEBUG}" == "1" ]; then - export DEBUG=1 -fi - -time python setup.py --quiet bdist_wheel --universal --dist-dir . -find . -maxdepth 1 -name "*.whl" -ls -exec pip install {} \; diff --git a/.travis/script.sh b/.travis/script.sh deleted file mode 100755 index 03ddaa48b45..00000000000 --- a/.travis/script.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/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" - -# onnx c++ API tests -export LD_LIBRARY_PATH="${top_dir}/.setuptools-cmake-build/:$LD_LIBRARY_PATH" -# do not use find -exec here, it would ignore the segement fault of gtest. -./.setuptools-cmake-build/onnx_gtests -./.setuptools-cmake-build/onnxifi_test_driver_gtests onnx/backend/test/data/node - -# onnx python API tests -if [ "${PYTHON_VERSION}" == "python2" ]; then - pip install --quiet pytest nbval -else - # pytest 6.0 made deprecation warnings fail by default, pinning pytest to 5.4.3. - # TODO replace deprecated function with the suggested one. https://docs.pytest.org/en/stable/deprecations.html#id5 - pip install --quiet pytest==5.4.3 nbval -fi - -pytest - -# lint python code -pip install --quiet flake8 -flake8 - -# Mypy only works with Python 3 -if [ "${PYTHON_VERSION}" != "python2" ]; then - # Mypy only works with our generated _pb.py files when we install in develop mode, so let's do that - pip uninstall -y onnx - time ONNX_NAMESPACE=ONNX_NAMESPACE_FOO_BAR_FOR_CI pip install --no-use-pep517 -e .[mypy] - - time python setup.py --quiet typecheck - - pip uninstall -y onnx - rm -rf .setuptools-cmake-build - time ONNX_NAMESPACE=ONNX_NAMESPACE_FOO_BAR_FOR_CI pip install . -fi - -# check line endings to be UNIX -find . -type f -regextype posix-extended -regex '.*\.(py|cpp|md|h|cc|proto|proto3|in)' | xargs dos2unix --quiet -git status -git diff --exit-code - -# check auto-gen files up-to-date -python onnx/defs/gen_doc.py -python onnx/gen_proto.py -l -python onnx/gen_proto.py -l --ml -python onnx/backend/test/stat_coverage.py -backend-test-tools generate-data -git status -git diff --exit-code -- . ':(exclude)onnx/onnx-data.proto' ':(exclude)onnx/onnx-data.proto3' - -# Do not hardcode onnx's namespace in the c++ source code, so that -# other libraries who statically link with onnx can hide onnx symbols -# in a private namespace. -! grep -R --include='*.cc' --include='*.h' 'namespace onnx' . -! grep -R --include='*.cc' --include='*.h' 'onnx::' . diff --git a/.travis/setup.sh b/.travis/setup.sh deleted file mode 100644 index 0306ad5b7fc..00000000000 --- a/.travis/setup.sh +++ /dev/null @@ -1,18 +0,0 @@ -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