提交 e80604f8 编写于 作者: H Hongsheng Zeng 提交者: Bo Zhou

run unittest in python2 and python3 (#55)

* run unittest in python2 and python3

* refine structure of repo

* refine structure of repo

* add --fix-misssing

* fix teamcity

* add --fix-misssing

* update paddle version in python2
上级 46188cd4
......@@ -15,10 +15,28 @@
# A dev image based on paddle production image
FROM paddlepaddle/paddle:1.1.0-gpu-cuda9.0-cudnn7
FROM paddlepaddle/paddle:1.3.0-gpu-cuda9.0-cudnn7
Run apt-get update
RUN apt-get install -y cmake
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gym
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple details
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple termcolor
RUN apt-get install --fix-missing -y cmake
# Prepare packages for Python
RUN apt-get install --fix-missing -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev
# Install python3.6 and pip3.6
RUN wget -q https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz && \
tar -xzf Python-3.6.0.tgz && cd Python-3.6.0 && \
CFLAGS="-Wformat" ./configure --prefix=/usr/local/ --enable-shared > /dev/null && \
make -j8 > /dev/null && make altinstall > /dev/null && \
cp libpython3.6m.so.1.0 /usr/lib/ && cp libpython3.6m.so.1.0 /usr/local/lib/
COPY ./requirements.txt /root/
# Requirements for python2
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r /root/requirements.txt
# Requirements for python3
RUN pip3.6 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r /root/requirements.txt
RUN pip3.6 install -i https://pypi.tuna.tsinghua.edu.cn/simple paddlepaddle-gpu==1.3.0.post97
gym
details
termcolor
......@@ -8,7 +8,7 @@ os:
env:
- JOB=check_style
script:
- docker run -it -v $PWD:/work -w /work paddlepaddle/paddle:latest-dev ./scripts/build.sh ${JOB}
- docker run -it -v $PWD:/work -w /work paddlepaddle/paddle:latest-dev ./.teamcity/build.sh ${JOB}
notifications:
email:
on_success: change
......
......@@ -24,10 +24,14 @@ function(py_test TARGET_NAME)
set(oneValueArgs "")
set(multiValueArgs SRCS DEPS ARGS ENVS)
cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_test(NAME ${TARGET_NAME}
add_test(NAME ${TARGET_NAME}_with_python2
COMMAND env PYTHONPATH=.:${py_test_ENVS}
python -u ${py_test_SRCS} ${py_test_ARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test(NAME ${TARGET_NAME}_with_python3
COMMAND env PYTHONPATH=.:${py_test_ENVS}
python3.6 -u ${py_test_SRCS} ${py_test_ARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endfunction()
if (WITH_TESTING)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册