forked from asyml/texar-pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
80 lines (73 loc) · 2.08 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
sudo: required
language: python
dist: xenial # Required for Python 3.7
cache: pip
python:
- "3.6"
- "3.7"
env:
- TORCH_VER="1.0.1"
- TORCH_VER="1.1.0"
- TORCH_VER="1.2.0"
matrix:
fast_finish: true
exclude:
- python: "3.6"
env: TORCH_VER="1.0.1"
- python: "3.6"
env: TORCH_VER="1.2.0"
install:
- pip install --upgrade pip
- pip install --progress-bar off torch==$TORCH_VER
- pip install --progress-bar off .[extras]
- if [[ $TORCH_VER == "1.2.0" ]]; then
pip install pylint==2.3.1 flake8==3.7.7;
fi
- if [[ $TORCH_VER != "1.0.1" ]]; then
pip install mypy==0.720;
fi
- pip install pytest
script:
# Linting (only for PyTorch version 1.2.0 to save time)
- if [[ $TORCH_VER == "1.2.0" ]]; then
pylint texar/ examples/;
fi
- if [[ $TORCH_VER == "1.2.0" ]]; then
flake8 texar/ examples/;
fi
# Type-checking (only for PyTorch version 1.1.0 & 1.2.0)
- if [[ $TORCH_VER != "1.0.1" ]]; then
mypy .;
fi
# Type-check all examples; fail if any example does not type-check
# To understand it:
# - Return code of for-loop is that of final command
# - `mypy $dir || _rc=$?` stores return code if not 0
# - `done && [[ $_rc == 0 ]];` returns 1 if for-loop returns zero and _rc is nonzero
- if [[ $TORCH_VER != "1.0.1" ]]; then
_rc=0;
for dir in `echo examples/**/`; do
mypy $dir || _rc=$?;
done && [[ $_rc == 0 ]];
fi
# Unit tests
- pytest
jobs:
include:
- stage: docs
python: "3.7"
install:
- pip install --upgrade pip
- pip install --progress-bar off -r requirements.txt
- pip install --progress-bar off .[extras]
# Install library required for spellcheck
- sudo apt-get install libenchant1c2a myspell-en-us
- pip install --progress-bar off -r docs/requirements.txt
script:
- cd docs
# Build documents
- sphinx-build -W -b html -d _build/doctrees . _build/html
# Check for typos
- sphinx-build -W -b spelling -d _build/doctrees . _build/spelling
notifications:
email: false