release_test.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # Test a release wheel in a fresh conda environment with and without installed
  3. # extensions
  4. # initialize the shell
  5. set -ex
  6. . $(conda info --base)/etc/profile.d/conda.sh
  7. JLAB_TEST_ENV="${CONDA_DEFAULT_ENV}_test"
  8. TEST_DIR=$(mktemp -d -t ${JLAB_TEST_ENV}XXXXX)
  9. conda create --override-channels --strict-channel-priority -c conda-forge -c anaconda -y -n "$JLAB_TEST_ENV" notebook nodejs twine
  10. conda activate "$JLAB_TEST_ENV"
  11. pip install dist/*.whl
  12. cp examples/notebooks/*.ipynb $TEST_DIR/
  13. python -m jupyterlab.browser_check
  14. jupyter lab clean --all
  15. pushd jupyterlab/tests/mock_packages
  16. jupyter labextension install mimeextension --no-build --debug
  17. jupyter labextension develop extension
  18. jupyter labextension build extension
  19. popd
  20. pushd $TEST_DIR
  21. conda install --override-channels --strict-channel-priority -c conda-forge -c anaconda -y ipywidgets altair matplotlib vega_datasets jupyterlab_widgets
  22. jupyter lab build
  23. python -m jupyterlab.browser_check
  24. # if not running on github actions, start JupyterLab
  25. if [[ -z "${GITHUB_ACTIONS}" ]]; then
  26. jupyter lab
  27. fi
  28. # undo our environment changes just in case we are sourcing this script
  29. conda deactivate
  30. popd