forked from HazyResearch/fonduer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
117 lines (105 loc) · 3.81 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
language: generic
dist: xenial
cache: pip
matrix:
include:
- os: linux
env:
- PYTHON=3.6
- os: linux
env:
- PYTHON=3.7
- os: osx
env:
- PYTHON=3.6
- os: osx
env:
- PYTHON=3.7
fast_finish: true
services:
- postgresql
addons:
postgresql: '9.6'
notifications:
email: false
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -y libmecab-dev swig mecab mecab-ipadic-utf8; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install swig mecab mecab-ipadic freetype; fi
- wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-$OS.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge
- conda update -q conda
- conda install -q conda-build
- if [ -n "$PYTHON" ]; then conda create -q -n test-environment python=${PYTHON}; fi
- source activate test-environment
- conda install -q pip
# Start postgresql for osx
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm -rf /usr/local/var/postgres; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then initdb /usr/local/var/postgres; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pg_ctl -D /usr/local/var/postgres start; sleep 5; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then createuser -s postgres; fi
- psql --version
- python --version
- pip --version
# Install PyTorch for Linux with no CUDA support
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ "${PYTHON}" = "3.6" ]; then
pip install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
fi
if [ "${PYTHON}" = "3.7" ]; then
pip install http://download.pytorch.org/whl/cpu/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl
fi
fi
install:
# Install fonduer dev deps and check code style
- make -s dev_extra
- make check
- make docs
- pip install -q coveralls
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt install cmake checkinstall libopenjp2-7-dev
wget https://poppler.freedesktop.org/poppler-0.62.0.tar.xz
tar -xf poppler-0.62.0.tar.xz
cd poppler-0.62.0
mkdir build
cd build
cmake ..
sudo checkinstall -y make install > /dev/null 2>&1
cd ../..
rm -rf poppler-0.62.0
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
echo "Using LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
else
brew install poppler
fi
- pdfinfo -v
- python -m spacy download en
before_script:
- psql -c 'create database parser_test;' -U postgres
- psql -c 'create database e2e_test;' -U postgres
- psql -c 'create database cand_test;' -U postgres
- psql -c 'create database meta_test;' -U postgres
- cd tests/
- "./download_data.sh"
- cd ..
script:
- travis_wait 50 coverage run --source=fonduer -m pytest tests
after_success:
- coveralls
deploy:
provider: pypi
user: lukehsiao
password:
secure: ddkakQE29dAbKo362iFHA1kAzPe6GuMV+zP5GkwYsglYgIOY+iYnPWlnZPaxLOkJyGTASOqOVdtRMg9K67kfTBT7h0yBOozZy6rs595cLX7gNLsjKHbciEK1pyebh82wMmiifCqNfwyf/epOqVAPxV8rzzVRw/x9lVMzNZasIpLQ1yVQyGjnAvm/8BIMhTFfN7DbASWpUUFBZDwjqLtHP8HsJLYucd4y7Hle9FqJ+HA7QGS71D+FVbYu16QNG2iwqnKLjYA8xJbNmzDCYUWZW6De89nbddoGmCfqCFXQK+aALpHjpy/vt811313c6sZy97glJmqRsTo7Z/xxmytYpG6+2Tvid1O0BS3AZOOVYEd/JvW3SURWuxdD1eI6LlZL6oAjNraq7h8XbPhyFfAsBXyahfsMA2tLoHqsLP0jnpVqcMzjn8auWGg0qWhNMxMCkMc0SSVY6mqvpQbnj7ntA5JaweCG56BddYqeOiSGtHhK56sGsQw7+CN/2l4GRlgT0FLkRVJBimD2yd2elyJK9r2gePeaD9Ea/Y2xhEIdilTMDSttZMMkwGsZqpY6//KiGGzFfyV66lWJkY6I1btCwB6DaW86lbRFvuqyzDwKbqZUyLdPHiBmoOjtmAtZyaUKQbnffqiGw1w0nu9viR22iF7zQctQ84R/wTq03tiZfco=
distributions: sdist bdist_wheel
skip_cleanup: true
on:
tags: true
branch: master
condition: $TRAVIS_OS_NAME = "linux" && $PYTHON = "3.7"