Release Process
This document outlines the standard operating procedure for releasing a new version of the VRE JupyterLab Extension. The process relies on a package-local automation script to minimize human error and ensure consistency across version manifests.
Pre-Release Requirements
Before initiating a release, ensure that: 1. All code changes have been reviewed and merged into the main branch. 2. Continuous Integration (CI) checks are passing. 3. The local working directory is clean (no uncommitted changes).
The Release Script
A custom Python script is provided at scripts/release.py. This script automates the tedious aspects of the release lifecycle.
To execute the release flow, run:
Script Operations
The release.py script performs the following sequence of operations:
- Version Prompting: Prompts the developer for the new semantic version (e.g.,
0.2.0). - Manifest Updating: Automatically updates the version strings in
package.json,setup.cfg,pyproject.toml, andvre_jupyterlab_extension/__init__.py. - Artifact Cleaning: Deletes old build directories (
dist,build,lib,labextension,*.egg-info) to guarantee a pristine build environment. - Dependency Synchronization: Executes
npm cito ensure exactly matching dependencies as specified inpackage-lock.json. - Frontend Compilation: Runs
npm run build:prodto generate the minified JupyterLab assets. - Distribution Generation: Invokes the Python
buildmodule in an isolated environment (python3 -m build --wheel --sdist) to produce the final.whland.tar.gzartifacts in thedist/directory.
Publishing to PyPI
Once the release script completes successfully, verify the contents of the dist/ directory. If the artifacts are sound, they can be uploaded to the Python Package Index.
If automated publishing via GitHub Actions is configured, you simply need to commit the version changes and push a signed git tag:
git add package.json setup.cfg pyproject.toml vre_jupyterlab_extension/__init__.py
git commit -m "chore: release version 0.2.0"
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin main --tags
The CI/CD pipeline will intercept the tag push and handle authentication and uploading to PyPI automatically.