Skip to content

Commit

Permalink
Separate sdist to another job, fix version in setup.py (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhers authored and neubig committed Dec 23, 2017
1 parent 77d5eb7 commit 2faafe9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .travis/build_dynet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions .travis/fix_version.sh
Original file line number Diff line number Diff line change
@@ -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

4 changes: 0 additions & 4 deletions .travis/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2faafe9

Please sign in to comment.