Skip to content

Commit f2d9b20

Browse files
authored
Merge pull request #134 from mckelvin/travis
Update .travis.yml
2 parents dc52359 + 32db889 commit f2d9b20

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

.travis.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
language: python
23
python:
34
- "2.7"
@@ -8,15 +9,20 @@ os:
89
- linux
910
env:
1011
global:
11-
- TA_INCLUDE_PATH=$HOME/dependencies/include
12-
- TA_LIBRARY_PATH=$HOME/dependencies/lib
13-
- LD_LIBRARY_PATH=$HOME/dependencies/lib
12+
- DEPS_DIR=$HOME/dependencies
13+
matrix:
14+
- WITH_TA_LIBRARY=yes
15+
TA_INCLUDE_PATH=$DEPS_DIR/include
16+
LD_LIBRARY_PATH=$DEPS_DIR/lib
17+
TA_LIBRARY_PATH=$DEPS_DIR/lib
18+
cache:
19+
directories:
20+
- $DEPS_DIR
1421
install:
22+
- pip install --upgrade pip wheel
1523
- pip install -r requirements_test.txt
16-
- mkdir $HOME/dependencies
17-
- wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
18-
- tar -xvzf ta-lib-0.4.0-src.tar.gz
19-
- pushd ta-lib && ./configure --prefix=$HOME/dependencies && make install && popd
24+
- if [ $WITH_TA_LIBRARY = "yes" ]; then
25+
./tools/build_talib_from_source.bash $DEPS_DIR;
26+
fi
2027
script:
21-
- make
2228
- make test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ clean:
2020
perf:
2121
python tools/perf_talib.py
2222

23-
test:
23+
test: build
2424
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} nosetests
2525

2626
sdist:

tools/build_talib_from_source.bash

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [[ -z $1 ]]; then
5+
echo "Usage: $0 deps_dir"
6+
exit 1
7+
fi
8+
9+
DEPS_DIR=$1
10+
11+
TA_LIB_TGZ="ta-lib-0.4.0-src.tar.gz"
12+
TA_LIB_URL="http://prdownloads.sourceforge.net/ta-lib/$TA_LIB_TGZ"
13+
14+
if [[ -d $DEPS_DIR/lib ]]; then
15+
echo "Already built"
16+
exit 0
17+
fi
18+
mkdir -p $DEPS_DIR/tmp
19+
wget -O "$DEPS_DIR/tmp/$TA_LIB_TGZ" $TA_LIB_URL
20+
pushd $DEPS_DIR/tmp
21+
tar -zxvf $TA_LIB_TGZ
22+
popd
23+
pushd $DEPS_DIR/tmp/ta-lib
24+
./configure --prefix=$DEPS_DIR
25+
make install
26+
popd

0 commit comments

Comments
 (0)