Skip to content

Commit

Permalink
Add release helper scripts and update release instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 7, 2019
1 parent 8cd72f7 commit afd7c21
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 35 deletions.
45 changes: 10 additions & 35 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,9 @@ setup instructions and for why twine is the recommended method.

## Getting a clean environment

### Clean environment with Conda
### Using Docker

For convenience, here are commands for getting a completely clean repo. This
makes sure that we don't have any extra tags or commits in our repo (especially
since we will push our tags later in the process), and that we are on the master
branch.

```bash
cd release
conda deactivate
conda remove --all -y -n jlabrelease
rm -rf jupyterlab

conda create -c conda-forge -y -n jlabrelease notebook nodejs twine
conda activate jlabrelease
```

### Clean environment with Docker

Instead of following the conda instructions above, you can use Docker to create a new container with a fresh clone of JupyterLab.
If desired, you can use Docker to create a new container with a fresh clone of JupyterLab.

First, build a Docker base image. This container is customized with your git commit information. The build is cached so rebuilding it is fast and easy.

Expand All @@ -53,21 +36,14 @@ docker run -it --name jlabrelease -w /usr/src/app jlabreleaseimage bash

Now you should be at a shell prompt as root inside the docker container (the prompt should be something like `root@20dcc0cdc0b4:/usr/src/app`).

## Set up JupyterLab
### Clean environment

Now clone the repo and build it

```bash
git clone https://github.com/jupyterlab/jupyterlab.git
cd jupyterlab
```

Check out the branch you are doing the release from, if different from master.
Then build and install jupyterlab:
For convenience, here is a script for getting a completely clean repo. This
makes sure that we don't have any extra tags or commits in our repo (especially
since we will push our tags later in the process), and that we are on the correct branch. The script creates a conda env, pulls down a git checkout with the
appropriate branch, and installs JupyterLab with `pip install -e .`.

```bash
pip install -ve .
```
`source scripts/release_prep.sh <branch_name>`

## Bump version

Expand Down Expand Up @@ -122,9 +98,8 @@ If there is a network error during JS publish, run `npm run publish:all --skip-b

Note that the use of `npm` instead of `jlpm` is [significant on Windows](https://github.com/jupyterlab/jupyterlab/issues/6733).

This is a good time to sanity-check the built packages. In another terminal, create a
new environment, pip install the wheel from the `dist/` directory, and run both
`jupyter lab` and `jupyter lab build`.
At this point, run the `source scripts/release_test.sh` to test the wheel in
a fresh conda environment with and without extensions installed.

## Finish

Expand Down
22 changes: 22 additions & 0 deletions scripts/release_prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Prep a fresh conda environment in a temporary folder for a release
if [[ $# -ne 1 ]]; then
echo "Specify branch"
exit 1
fi
branch=$1
env=jlabrelease_$branch

WORK_DIR=`mktemp -d`
cd $WORK_DIR
conda deactivate
conda remove --all -y -n jlabrelease_$branch

conda create -c conda-forge -y -n $env notebook nodejs twine
conda activate $env

git clone https://github.com/jupyterlab/jupyterlab.git
cd jupyterlab

git checkout $branch

pip install -ve .
32 changes: 32 additions & 0 deletions scripts/release_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Test a release wheel in a fresh conda environment with and without installed
# extensions
set -e
env=${CONDA_DEFAULT_ENV}_test

conda deactivate
conda remove --all -y -n $env

conda create -c conda-forge -y -n $env notebook nodejs twine
conda activate $env

pip install dist/*.whl

WORK_DIR=`mktemp -d`
cp examples/notebooks/*.ipynb $WORK_DIR
cd $WORK_DIR

python -m jupyterlab.browser_check

jupyter labextension install @jupyterlab/fasta-extension --no-build
jupyter labextension install @jupyterlab/geojson-extension --no-build
jupyter labextension install @jupyterlab/plotly-extension --no-build
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension install bqplot --no-build
jupyter labextension install jupyter-leaflet --no-build
jupyter lab clean
jupyter lab build

conda install -c conda-forge -y ipywidgets
python -m jupyterlab.browser_check

jupyter lab

0 comments on commit afd7c21

Please sign in to comment.