travis_install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. # Building should work without yarn installed globally
  7. rm /home/travis/.yarn/bin/*
  8. !yarn --version
  9. # The miniconda directory may exist if it has been restored from cache
  10. if [ -d "$MINICONDA_DIR" ] && [ -e "$MINICONDA_DIR/bin/conda" ]; then
  11. echo "Miniconda install already present from cache: $MINICONDA_DIR"
  12. else # if it does not exist, we need to install miniconda
  13. rm -rf "$MINICONDA_DIR" # remove the directory in case we have an empty cached directory
  14. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -nv -O ~/miniconda.sh;
  15. set +ev
  16. bash ~/miniconda.sh -b -p "$MINICONDA_DIR"
  17. set -ev
  18. chown -R "$USER" "$MINICONDA_DIR"
  19. hash -r
  20. fi
  21. export PATH="$MINICONDA_DIR/bin:$PATH"
  22. conda config --set always_yes yes --set changeps1 no
  23. conda update -q conda
  24. conda info -a # for debugging
  25. conda remove --name test --all || true
  26. conda create -q -n test --quiet -c conda-forge notebook pytest python=$PYTHON
  27. set +ev
  28. source activate test
  29. set -ev
  30. # create jupyter base dir (needed for config retrieval)
  31. mkdir ~/.jupyter
  32. # Install and enable the server extension
  33. pip install -q -e ".[test]"
  34. jlpm versions
  35. jlpm config current
  36. jupyter serverextension enable --py jupyterlab