Skip to content

Commit

Permalink
[travis] python
Browse files Browse the repository at this point in the history
  • Loading branch information
mli committed Oct 9, 2015
1 parent c477ba9 commit 56d4d5d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ before_install:
- export PYTHONPATH=${PYTHONPATH}:${PWD}/python

install:
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then tests/travis/setup_osx.sh; fi
- if [ ${TASK} == "lint" ]; then pip install cpplint pylint graphviz --user `whoami`; fi
- source tests/travis/setup.sh

script:
- tests/travis/run_test.sh
Expand Down
35 changes: 20 additions & 15 deletions tests/travis/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,26 @@ if [ ${TASK} == "python_test" ]; then
mkdir -p ${CACHE_PREFIX}/data
ln -s ${CACHE_PREFIX}/data tests/python/data

python --version
cd python && python setup.py develop --user && cd .. || exit -1
# python --version
# cd python && python setup.py develop --user && cd .. || exit -1

if [ ${TRAVIS_OS_NAME} == "osx" ]; then
python -m nose tests/python/unittest || exit -1
python -m nose tests/python/train || exit -1
else
nosetests tests/python/unittest || exit -1
nosetests tests/python/train || exit -1
python -m nose tests/python/unittest || exit -1
python -m nose tests/python/train || exit -1

# TODO(mli) python3 error
# python3 --version
# rm -rf python/mxnet.egg-info
# cd python && python3 setup.py develop --user && cd .. || exit -1
# nosetests3 tests/python/unittest || exit -1
# nosetests3 tests/python/train || exit -1
fi
python3 -m nose tests/python/unittest || exit -1
python3 -m nose tests/python/train || exit -1

# if [ ${TRAVIS_OS_NAME} == "osx" ]; then
# else

# nosetests tests/python/unittest || exit -1
# nosetests tests/python/train || exit -1

# # TODO(mli) python3 error
# # python3 --version
# # rm -rf python/mxnet.egg-info
# # cd python && python3 setup.py develop --user && cd .. || exit -1
# # nosetests3 tests/python/unittest || exit -1
# # nosetests3 tests/python/train || exit -1
# fi
fi
18 changes: 18 additions & 0 deletions tests/travis/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [ ${TRAVIS_OS_NAME} == "osx" ]; then
brew update
brew tap homebrew/science
brew info opencv
brew install opencv
brew install python3
fi

if [ ${TASK} == "lint" ]; then
pip install cpplint pylint graphviz --user `whoami`
fi

if [ ${TASK} == "python_test"]; then
python -m pip install nose numpy --user `whoami`
python3 -m pip install nose numpy --user `whoami`
fi
3 changes: 2 additions & 1 deletion tests/travis/setup_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ brew tap homebrew/science
brew info opencv
# brew install graphviz
brew install opencv
brew install python3

# TODO(mli) TASK are not correct...
# if [ ${TASK} == "python-package3" ]; then
Expand All @@ -30,4 +31,4 @@ brew install opencv
# source activate myenv
# conda install numpy scipy matplotlib nose

python -m pip install nose numpy --user `whoami`
# python -m pip install nose numpy --user `whoami`

0 comments on commit 56d4d5d

Please sign in to comment.