release_test.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. OUTPUT_DIR=$(pwd)/build/${GROUP}_output
  8. JLAB_TEST_ENV="${CONDA_DEFAULT_ENV}_test"
  9. TEST_DIR=$(mktemp -d -t ${JLAB_TEST_ENV}XXXXX)
  10. conda create --override-channels --strict-channel-priority -c conda-forge -c nodefaults -y -n "$JLAB_TEST_ENV" 'nodejs>=10,!=13.*,!=15.*,!=17.*' pip wheel setuptools
  11. conda activate "$JLAB_TEST_ENV"
  12. python -m pip install $(ls dist/*.whl)
  13. cp examples/notebooks/*.ipynb $TEST_DIR/
  14. pushd $TEST_DIR
  15. JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check
  16. jupyter lab clean --all
  17. popd
  18. pushd jupyterlab/tests/mock_packages
  19. jupyter labextension install mimeextension --no-build --debug
  20. jupyter labextension develop extension
  21. jupyter labextension build extension
  22. popd
  23. pushd $TEST_DIR
  24. conda install --override-channels --strict-channel-priority -c conda-forge -c nodefaults -y ipywidgets altair matplotlib-base vega_datasets jupyterlab_widgets
  25. popd
  26. # re-install, because pip
  27. python -m pip install $(ls dist/*.whl)
  28. # back to testing
  29. pushd $TEST_DIR
  30. jupyter lab build
  31. JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check
  32. # if not running on github actions, start JupyterLab
  33. if [[ -z "${GITHUB_ACTIONS}" ]]; then
  34. jupyter lab
  35. fi
  36. # undo our environment changes just in case we are sourcing this script
  37. conda deactivate
  38. popd