Skip to main content

VRE JupyterLab Extension with VRE DSL highlighting and notebook execution guard

Project description

VRE JupyterLab Extension

Extension PR CI

@virtmat/vre-jupyterlab-extension is a frontend-only JupyterLab 4 extension providing:

  • CodeMirror 6 syntax highlighting for VRE DSL notebooks and .vm files
  • execution guard for declarative workflows (executed-cell visuals + re-execution blocking)

Runtime Assumptions

  • Linux-only development workflow
  • Jupyter commands are executed through ./vre/bin/python -m jupyter
  • Intended kernel integration target: vre-language with vre-middleware

Settings

This extension provides JupyterLab plugin settings via schema/plugin.json:

  • enabled (default true): enables MIME synchronization and execution guard behavior.
  • cellReadonlyDesignEnabled (default true): controls executed-cell readonly lock and visual treatment.

Commands

Open the Command Palette and run:

  • VRE: Toggle Cell Readonly Design
  • VRE: Toggle Extension

All toggles apply immediately and persist through refresh/restart via JupyterLab settings.

Development

  • Install workspace dependencies: npm install
  • Build package and bundled labextension assets: npm run -w @virtmat/vre-jupyterlab-extension build
  • Run tests: npm run -w @virtmat/vre-jupyterlab-extension test

Python Packaging And Installation

This extension is packaged as a prebuilt JupyterLab extension so end users can install it directly from PyPI with pip install vre-jupyterlab-extension and use it immediately, without any Node or JupyterLab extension setup.

Build local wheel/sdist

From the package root (packages/vre-jupyterlab-extension):

  • npm ci
  • npm run build
  • python -m pip install --upgrade build
  • python -m build --wheel --sdist

Install via pip

Add to requirements.txt

Once published, add one of these lines in requirements.txt for vre-language or vre-middleware.

-- pip install vre-jupyterlab-extension==0.1.1 -- PyPI release: vre-jupyterlab-extension==0.1.1 -- GitHub tag build: vre-jupyterlab-extension @ git+https://github.com/<org>/<repo>.git@vre-jupyterlab-extension-v0.1.1#subdirectory=packages/vre-jupyterlab-extension -- GitLab tag build: vre-jupyterlab-extension @ git+https://gitlab.com/<group>/<repo>.git@vre-jupyterlab-extension-v0.1.1#subdirectory=packages/vre-jupyterlab-extension

Install dependencies as usual and the extension package is pulled in automatically.

Release Automation

GitHub

  • Workflow file: .github/workflows/extension-publish.yml
  • Trigger: push a tag (vre-jupyterlab-extension-vX.Y.Z or vX.Y.Z) or run manually.
  • Required secrets:
    • PYPI_API_TOKEN for publishing to PyPI.
    • THE_GITHUB_PACKAGES_TOKEN for publishing to GitHub Packages.

GitLab

  • CI file: .gitlab-ci.yml
  • Trigger: tag pipeline.
  • Publishes to GitLab Package Registry using CI_JOB_TOKEN.

Versioning And Updates

  • Keep Python package version (setup.cfg) and npm package version (package.json) aligned.
  • For downstream repos (vre-language, vre-middleware), pin exact versions in requirements.txt.
  • To automate dependency bumps in downstream repos, enable Dependabot or Renovate for requirements.txt.

Note: JupyterLab does not auto-upgrade Python packages by itself. Upgrades are applied when your environment runs pip install -U ... or recreates the environment from updated lock/requirements files.

CI Commands

  • PR pipeline entrypoint: npm run -w @virtmat/vre-jupyterlab-extension ci
  • Unit tests (TAP output): npm run -w @virtmat/vre-jupyterlab-extension ci:test:unit
  • Smoke integration tests (PR): npm run -w @virtmat/vre-jupyterlab-extension ci:test:integration:smoke
  • Full integration suite (nightly): npm run -w @virtmat/vre-jupyterlab-extension ci:test:integration:full
  • Build PR summary artifacts: npm run -w @virtmat/vre-jupyterlab-extension ci:summary

CI summary artifacts are written to packages/vre-jupyterlab-extension/tests/:

  • test-results.tap
  • ci-summary.json
  • ci-summary.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vre_jupyterlab_extension-0.1.2.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vre_jupyterlab_extension-0.1.2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file vre_jupyterlab_extension-0.1.2.tar.gz.

File metadata

  • Download URL: vre_jupyterlab_extension-0.1.2.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vre_jupyterlab_extension-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1805f709d962817d6503a9323c325b55d898d3adab85a4f2b179a8cacb55f6fa
MD5 26ca85c96a030d0da48efe73a94cbce1
BLAKE2b-256 01f7b89c5c238adac512e87ed6f73de86a735ca60729734312a604abbb88336e

See more details on using hashes here.

File details

Details for the file vre_jupyterlab_extension-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for vre_jupyterlab_extension-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4312a6f50d0d76b80a32a57275b58507b48482eeb3fd8625175a3c23bf37c42d
MD5 fee773c68f67f20f3a1e3fc42d760a64
BLAKE2b-256 7c80e0d4be43473b05f8fb72341ab56d454b5f156b3ff5ee743b8c527d35daa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page