install.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/bin/bash
  2. # Based on a script from scikit-learn
  3. # This script is meant to be called by the "install" step defined in
  4. # .travis.yml. See http://docs.travis-ci.com/ for more details.
  5. # The behavior of the script is controlled by environment variabled defined
  6. # in the .travis.yml in the top level folder of the project.
  7. set -e
  8. # Fix the compilers to workaround avoid having the Python 3.4 build
  9. # lookup for g++44 unexpectedly.
  10. export CC=gcc
  11. export CXX=g++
  12. if [[ "$DISTRIB" == "conda_min" ]]; then
  13. # Deactivate the travis-provided virtual environment and setup a
  14. # conda-based environment instead
  15. deactivate
  16. # Use the miniconda installer for faster download / install of conda
  17. # itself
  18. wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
  19. -O miniconda.sh
  20. chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
  21. export PATH=/home/travis/miniconda/bin:$PATH
  22. conda config --set always_yes yes
  23. conda update --yes conda
  24. # Configure the conda environment and put it in the path using the
  25. # provided versions
  26. conda create -n testenv --yes python=$PYTHON_VERSION pip nose coverage \
  27. six=$SIX_VERSION numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION
  28. source activate testenv
  29. conda install libgfortran=1
  30. if [[ "$INSTALL_MKL" == "true" ]]; then
  31. # Make sure that MKL is used
  32. conda install --yes --no-update-dependencies mkl
  33. else
  34. # Make sure that MKL is not used
  35. conda remove --yes --features mkl || echo "MKL not installed"
  36. fi
  37. elif [[ "$DISTRIB" == "conda" ]]; then
  38. # Deactivate the travis-provided virtual environment and setup a
  39. # conda-based environment instead
  40. deactivate
  41. # Use the miniconda installer for faster download / install of conda
  42. # itself
  43. wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
  44. -O miniconda.sh
  45. chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
  46. export PATH=/home/travis/miniconda/bin:$PATH
  47. conda config --set always_yes yes
  48. conda update --yes conda
  49. # Configure the conda environment and put it in the path using the
  50. # provided versions
  51. conda create -n testenv --yes python=$PYTHON_VERSION pip nose coverage six=$SIX_VERSION \
  52. numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION pandas=$PANDAS_VERSION scikit-learn
  53. source activate testenv
  54. if [[ "$INSTALL_MKL" == "true" ]]; then
  55. # Make sure that MKL is used
  56. conda install --yes --no-update-dependencies mkl
  57. else
  58. # Make sure that MKL is not used
  59. conda remove --yes --features mkl || echo "MKL not installed"
  60. fi
  61. if [[ "$COVERAGE" == "true" ]]; then
  62. pip install coveralls
  63. fi
  64. python -c "import pandas; import os; assert os.getenv('PANDAS_VERSION') == pandas.__version__"
  65. elif [[ "$DISTRIB" == "ubuntu" ]]; then
  66. deactivate
  67. # Create a new virtualenv using system site packages for numpy and scipy
  68. virtualenv --system-site-packages testenv
  69. source testenv/bin/activate
  70. pip install nose
  71. pip install coverage
  72. pip install numpy==$NUMPY_VERSION
  73. pip install scipy==$SCIPY_VERSION
  74. pip install six==$SIX_VERSION
  75. pip install quantities
  76. fi
  77. if [[ "$COVERAGE" == "true" ]]; then
  78. pip install coveralls
  79. fi
  80. # pip install neo==0.3.3
  81. wget https://github.com/NeuralEnsemble/python-neo/archive/master.tar.gz
  82. tar -xzvf master.tar.gz
  83. pushd python-neo-master
  84. python setup.py install
  85. popd
  86. pip install .
  87. python -c "import numpy; import os; assert os.getenv('NUMPY_VERSION') == numpy.__version__"
  88. python -c "import scipy; import os; assert os.getenv('SCIPY_VERSION') == scipy.__version__"