diff --git a/.travis.yml b/.travis.yml index 04c132d97..f53a732ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -159,6 +159,12 @@ jobs: python: 3.6 before_script: pip install dynet script: python tests/python/test.py + - os: linux + language: python + python: 3.6 + before_script: .travis/fix_version.sh + script: python setup.py sdist + if: tag IS present install: - travis_retry .travis/install_dependencies.sh diff --git a/.travis/build_dynet.sh b/.travis/build_dynet.sh index cdd3b6f26..c887d997c 100755 --- a/.travis/build_dynet.sh +++ b/.travis/build_dynet.sh @@ -12,10 +12,7 @@ if [[ "$PYTHON_INSTALL" == manual ]]; then cd build cmake .. $BACKEND_OPTION -DEIGEN3_INCLUDE_DIR="$EIGEN3_INCLUDE_DIR" -DENABLE_BOOST=ON -DENABLE_CPP_EXAMPLES=ON -DPYTHON=$(which python) -DCMAKE_INSTALL_PREFIX=$(dirname $(which python))/.. else # pip - if [[ -n "$TRAVIS_TAG" ]]; then - sed -i.bak "s/# version=.*/version=\"$TRAVIS_TAG\",/" setup.py - sed -i.bak "s/ -march=native//" CMakeLists.txt - fi + .travis/fix_version.sh if [[ "$TRAVIS_OS_NAME" == linux ]]; then docker build --rm -t "dynet-manylinux1-${BUILD_ARCH}-builder" -f "docker/Dockerfile-$BUILD_ARCH" . docker run -e PYVER -e BUILD_ARCH -e TRAVIS_BUILD_DIR=/build -v "$TRAVIS_BUILD_DIR":/build --rm "dynet-manylinux1-${BUILD_ARCH}-builder" /root/.travis/build_linux_wheel.sh diff --git a/.travis/fix_version.sh b/.travis/fix_version.sh new file mode 100755 index 000000000..e9f783ce2 --- /dev/null +++ b/.travis/fix_version.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -xe + +cd "$TRAVIS_BUILD_DIR" +if [[ -n "$TRAVIS_TAG" ]]; then + sed -i.bak "s/# version=.*/version=\"$TRAVIS_TAG\",/" setup.py + sed -i.bak "s/ -march=native//" CMakeLists.txt +fi + diff --git a/.travis/install_dependencies.sh b/.travis/install_dependencies.sh index f64c40c37..dbba465ab 100755 --- a/.travis/install_dependencies.sh +++ b/.travis/install_dependencies.sh @@ -46,10 +46,6 @@ if [[ "$BACKEND" == cuda ]]; then sudo ln -s /usr/local/cuda-${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} /usr/local/cuda fi -if [[ "$TRAVIS_OS_NAME" == linux ]]; then - python setup.py sdist # Build sdist -fi - # Eigen hg clone https://bitbucket.org/eigen/eigen/ -r 699b659 cd eigen