travis_install.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. set -ev
  5. set -o pipefail
  6. # The miniconda directory may exist if it has been restored from cache
  7. if [ -d "$MINICONDA_DIR" ] && [ -e "$MINICONDA_DIR/bin/conda" ]; then
  8. echo "Miniconda install already present from cache: $MINICONDA_DIR"
  9. else # if it does not exist, we need to install miniconda
  10. rm -rf "$MINICONDA_DIR" # remove the directory in case we have an empty cached directory
  11. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -b -O ~/miniconda.sh;
  12. bash ~/miniconda.sh -b -p "$MINICONDA_DIR"
  13. chown -R "$USER" "$MINICONDA_DIR"
  14. hash -r
  15. fi
  16. export PATH="$MINICONDA_DIR/bin:$PATH"
  17. conda config --set always_yes yes --set changeps1 no
  18. conda update -q conda
  19. conda info -a # for debugging
  20. conda remove --name test --all || true
  21. conda create -n test -c conda-forge notebook pytest python=$PYTHON
  22. set +ev
  23. source activate test
  24. set -ev
  25. # create jupyter base dir (needed for config retrieval)
  26. mkdir ~/.jupyter
  27. # Building should work without yarn installed globally, so uninstall the
  28. # global yarn that Travis installs automatically.
  29. sudo rm -rf `which yarn`
  30. yarn --version
  31. # Install and enable the server extension
  32. pip install -v -e ".[test]"
  33. jlpm versions
  34. jlpm config current
  35. jupyter serverextension enable --py jupyterlab