travis_install.sh 1.3 KB

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