release_test.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. popd
  17. pushd jupyterlab/tests/mock_packages
  18. jupyter labextension install mimeextension --no-build --debug
  19. jupyter labextension develop extension
  20. jupyter labextension build extension
  21. popd
  22. pushd $TEST_DIR
  23. conda install --override-channels --strict-channel-priority -c conda-forge -c nodefaults -y ipywidgets altair matplotlib-base vega_datasets jupyterlab_widgets
  24. popd
  25. # re-install, because pip
  26. python -m pip install $(ls dist/*.whl)
  27. # back to testing
  28. pushd $TEST_DIR
  29. jupyter lab build
  30. JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check
  31. # if not running on github actions, start JupyterLab
  32. if [[ -z "${GITHUB_ACTIONS}" ]]; then
  33. jupyter lab
  34. fi
  35. # undo our environment changes just in case we are sourcing this script
  36. conda deactivate
  37. popd