Skip to content

Update .travis.yml #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
language: python
python:
- "2.7"
Expand All @@ -8,15 +9,20 @@ os:
- linux
env:
global:
- TA_INCLUDE_PATH=$HOME/dependencies/include
- TA_LIBRARY_PATH=$HOME/dependencies/lib
- LD_LIBRARY_PATH=$HOME/dependencies/lib
- DEPS_DIR=$HOME/dependencies
matrix:
- WITH_TA_LIBRARY=yes
TA_INCLUDE_PATH=$DEPS_DIR/include
LD_LIBRARY_PATH=$DEPS_DIR/lib
TA_LIBRARY_PATH=$DEPS_DIR/lib
Copy link
Contributor Author

@mckelvin mckelvin Feb 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the Build ta-lib from source if the library is not found (#111 (comment)) feature is merged, I'll add a line of

- WITH_TA_LIBRARY=no

in the matrix section to setup test cases for the feature.

cache:
directories:
- $DEPS_DIR
install:
- pip install --upgrade pip wheel
- pip install -r requirements_test.txt
- mkdir $HOME/dependencies
- wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
- tar -xvzf ta-lib-0.4.0-src.tar.gz
- pushd ta-lib && ./configure --prefix=$HOME/dependencies && make install && popd
- if [ $WITH_TA_LIBRARY = "yes" ]; then
./tools/build_talib_from_source.bash $DEPS_DIR;
fi
script:
- make
- make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ clean:
perf:
python tools/perf_talib.py

test:
test: build
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} nosetests

sdist:
Expand Down
26 changes: 26 additions & 0 deletions tools/build_talib_from_source.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

if [[ -z $1 ]]; then
echo "Usage: $0 deps_dir"
exit 1
fi

DEPS_DIR=$1

TA_LIB_TGZ="ta-lib-0.4.0-src.tar.gz"
TA_LIB_URL="http://prdownloads.sourceforge.net/ta-lib/$TA_LIB_TGZ"

if [[ -d $DEPS_DIR/lib ]]; then
echo "Already built"
exit 0
fi
mkdir -p $DEPS_DIR/tmp
wget -O "$DEPS_DIR/tmp/$TA_LIB_TGZ" $TA_LIB_URL
pushd $DEPS_DIR/tmp
tar -zxvf $TA_LIB_TGZ
popd
pushd $DEPS_DIR/tmp/ta-lib
./configure --prefix=$DEPS_DIR
make install
popd