release_test.sh 1.7 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.*' 'python!=3.10.0' 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. cp -r jupyterlab/tests/mock_packages $TEST_DIR
  15. pushd $TEST_DIR
  16. ls -ltr
  17. JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check
  18. # Remove node_modules to get a clean directory and build the extensions
  19. rm -rf ./mock_packages/mimeextension/node_modules
  20. rm -rf ./mock_packages/extension/node_modules
  21. jupyter labextension install ./mock_packages/mimeextension --no-build --debug
  22. jupyter labextension develop ./mock_packages/extension --debug
  23. jupyter labextension build ./mock_packages/extension --debug
  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 --debug
  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