Skip to content

Commit 01c668e

Browse files
authored
Merge pull request #3310 from luotao1/doc
reduce travis-ci time of build_doc
2 parents 382de96 + a055cb1 commit 01c668e

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ before_install:
3838
# Paddle is using protobuf 3.1 currently. Protobuf 3.2 breaks the compatibility. So we specify the python
3939
# protobuf version.
4040
- pip install numpy wheel 'protobuf==3.1' sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit requests==2.9.2 LinkChecker
41-
- pip install rarfile
41+
- pip install rarfile nltk==3.2.2 scipy==0.19.0 recordio matplotlib Pillow
4242
- curl https://glide.sh/get | bash
4343
- eval "$(GIMME_GO_VERSION=1.8.3 gimme)"
4444
- go get -u github.com/alecthomas/gometalinter

doc/templates/conf.py.cn.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
# serve to show the default.
1414
import sys
1515
import os, subprocess
16+
sys.path.insert(0, os.path.abspath('@PROJ_ROOT@/python'))
1617
import shlex
1718
from recommonmark import parser, transform
18-
try:
19-
import py_paddle
20-
import paddle
21-
import paddle.v2
22-
except ImportError:
23-
print("Must install paddle python package before generating documentation")
24-
sys.exit(1)
19+
import paddle
20+
import paddle.v2
2521

2622
MarkdownParser = parser.CommonMarkParser
2723
AutoStructify = transform.AutoStructify

doc/templates/conf.py.en.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
# serve to show the default.
1414
import sys
1515
import os, subprocess
16+
sys.path.insert(0, os.path.abspath('@PROJ_ROOT@/python'))
1617
import shlex
1718
from recommonmark import parser, transform
18-
try:
19-
import py_paddle
20-
import paddle
21-
import paddle.v2
22-
except ImportError:
23-
print("Must install paddle python package before generating documentation")
24-
sys.exit(1)
19+
import paddle
20+
import paddle.v2
2521

2622

2723
MarkdownParser = parser.CommonMarkParser

paddle/scripts/travis/build_doc.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ set -e
55
mkdir -p $TRAVIS_BUILD_DIR/build
66
cd $TRAVIS_BUILD_DIR/build
77

8-
# Compile paddle binaries first
9-
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_MKLDNN=OFF -DWITH_MKLML=OFF -DWITH_GOLANG=ON -DWITH_STYLE_CHECK=OFF
10-
11-
mkdir output
12-
make -j `nproc`
13-
find .. -name '*whl' | xargs pip install # install all wheels.
14-
rm -rf *
158
# Compile Documentation only.
169
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_MKLDNN=OFF -DWITH_MKLML=OFF -DWITH_DOC=ON
10+
make -j `nproc` gen_proto_py
1711
make -j `nproc` paddle_docs paddle_docs_cn
1812

1913
# check websites for broken links
@@ -35,6 +29,7 @@ TARGET_BRANCH="gh-pages"
3529
SOURCE_BRANCH="master"
3630

3731
# Clone the repo to output directory
32+
mkdir output
3833
git clone $REPO output
3934
cd output
4035

proto/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ foreach(filename ${proto_filenames})
1717
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
1818
ARGS "--python_out=${PROJ_ROOT}/python/paddle/proto"
1919
"-I" ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}
20-
DEPENDS ${ABS_FIL} ${external_project_dependencies})
20+
DEPENDS ${ABS_FIL} protoc)
2121
endforeach()
2222

2323
add_custom_target(gen_proto_py ALL DEPENDS ${PROTO_GEN_PY})

0 commit comments

Comments
 (0)