<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj" -->

---
title: Writing a workshop for JupyterLab | daily.dev
description: A hands-on walkthrough of building a complete JupyterLab workshop from scratch using jupyterlab-workshop, teaching pytest through four pages. Covers writing...
canonical: https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Writing a workshop for JupyterLab | daily.dev
og:description: A hands-on walkthrough of building a complete JupyterLab workshop from scratch using jupyterlab-workshop, teaching pytest through four pages. Covers writing...
og:url: https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj
og:image: https://api.daily.dev/og/posts/4sUWGvcbJ.png
og:image:alt: Writing a workshop for JupyterLab
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing a workshop for JupyterLab

**[Planet Python](https://daily.dev/sources/planetpython)** · 19 min read · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough of building a complete JupyterLab workshop from scratch using jupyterlab-workshop, teaching pytest through four pages. Covers writing the manifest, declaring capabilities, creating an isolated Python environment, writing actions (file-open, execute, verify, quiz, editor-insert, editor-replace), linting for mechanical errors, running a self-test that drives a headless browser through the workshop, using author mode inside JupyterLab, and publishing a reproducible archive. Emphasizes checking outcomes rather than keystrokes and gating progress on quizzes and passing checks.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://grahamdumpleton.me/posts/2026/09/writing-a-workshop-for-jupyterlab>

## Questions this post answers

### How do you prevent Python from running stale cached bytecode when files change rapidly during quick edits?

Setting the PYTHONDONTWRITEBYTECODE environment variable to 1 disables bytecode caching, which avoids a problem where Python reuses cached bytecode when a source file's size and modification time in whole seconds are unchanged. This happens when an edit swaps text of the same length within a second of the previous run, causing the old code to execute instead of the new version.

_Anyone debugging flaky reruns after quick edits can find fixes like this collected on daily.dev._

### How do I write a pytest check that reports the outcome instead of just echoing terminal output?

Run pytest itself inside the check command rather than parsing what the terminal printed, then shape stdout with shell logic: on success print only the last summary line and exit zero, on failure print full output and exit one. Using --color=no strips escape codes from the message. This makes the check pass regardless of how the learner ran the command, since it verifies the actual test outcome rather than keystrokes.

_Developers building reliable verification steps into tooling often track these testing patterns on daily.dev._

### What does a self-test tool for an interactive tutorial actually verify before learners see it?

It copies the workshop to a temporary directory, starts a fresh JupyterLab instance on a free port, opens the workshop in a headless browser, and replays every action page by page: running commands, answering quizzes correctly, and executing every check, reporting pass/fail per action with timing. This catches drift caused by a tool changing its output or a package changing behavior before a learner encounters it.

_Teams maintaining living tutorials can follow tooling like this that keeps hands-on content verified, via daily.dev._

## Similar posts on daily.dev

- [Introducing jupyterlab-workshop](https://daily.dev/posts/introducing-jupyterlab-workshop-q39fh3kw6) · Planet Python · 0 upvotes · 0 comments
- [A master class in decorators, patching and tracing](https://daily.dev/posts/a-master-class-in-decorators-patching-and-tracing-bt3chlbss) · Planet Python · 0 upvotes · 0 comments
- [Day 5: Virtual Environments & Jupyter Notebooks, Setting Up Your Actual AI Workspace](https://daily.dev/posts/day-5-virtual-environments-jupyter-notebooks-setting-up-your-actual-ai-workspace-ocjuj5nro) · Medium · 1 upvotes · 0 comments
- [Jupyter Notebook: An Introduction Quiz – Real Python](https://daily.dev/posts/jupyter-notebook-an-introduction-quiz-real-python-u6ifcbyus) · Real Python · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#career](https://daily.dev/tags/career), [#testing](https://daily.dev/tags/testing), [#jupyter](https://daily.dev/tags/jupyter)

[View this post on daily.dev](https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Writing a workshop for JupyterLab","url":"https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj"},"datePublished":"2026-09-18T04:51:16.220Z","dateModified":"2026-09-18T05:59:32.387Z","description":"A hands-on walkthrough of building a complete JupyterLab workshop from scratch using jupyterlab-workshop, teaching pytest through four pages. Covers writing...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7dc6d28d89e7d0415208b9b108b74b73?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7dc6d28d89e7d0415208b9b108b74b73?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/eac3cc584cb043b5a242d13752bd3d0c","url":"https://daily.dev/sources/planetpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,career,testing,jupyter","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet Python","item":"https://daily.dev/sources/planetpython"},{"@type":"ListItem","position":3,"name":"Writing a workshop for JupyterLab"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/writing-a-workshop-for-jupyterlab-4suwgvcbj#faq","mainEntity":[{"@type":"Question","name":"How do you prevent Python from running stale cached bytecode when files change rapidly during quick edits?","acceptedAnswer":{"@type":"Answer","text":"Setting the PYTHONDONTWRITEBYTECODE environment variable to 1 disables bytecode caching, which avoids a problem where Python reuses cached bytecode when a source file's size and modification time in whole seconds are unchanged. This happens when an edit swaps text of the same length within a second of the previous run, causing the old code to execute instead of the new version. Anyone debugging flaky reruns after quick edits can find fixes like this collected on daily.dev."}},{"@type":"Question","name":"How do I write a pytest check that reports the outcome instead of just echoing terminal output?","acceptedAnswer":{"@type":"Answer","text":"Run pytest itself inside the check command rather than parsing what the terminal printed, then shape stdout with shell logic: on success print only the last summary line and exit zero, on failure print full output and exit one. Using --color=no strips escape codes from the message. This makes the check pass regardless of how the learner ran the command, since it verifies the actual test outcome rather than keystrokes. Developers building reliable verification steps into tooling often track these testing patterns on daily.dev."}},{"@type":"Question","name":"What does a self-test tool for an interactive tutorial actually verify before learners see it?","acceptedAnswer":{"@type":"Answer","text":"It copies the workshop to a temporary directory, starts a fresh JupyterLab instance on a free port, opens the workshop in a headless browser, and replays every action page by page: running commands, answering quizzes correctly, and executing every check, reporting pass/fail per action with timing. This catches drift caused by a tool changing its output or a package changing behavior before a learner encounters it. Teams maintaining living tutorials can follow tooling like this that keeps hands-on content verified, via daily.dev."}}]}
```

