Skip to content

Commit 51f1b3a

Browse files
authored
Add Micromamba prereq and steps to setup workshop environment (#39)
* Add Micromamba prereq and steps to setup workshop environment * Fixup numbering error * Update conda CLI instructions Additional explanation Clearer organization of text Mention pixi Recommend micromamba over miniforge * Add Python & pip to environment * Remove blunt language about Anaconda TOS * Remove venv instructions
1 parent 23fad66 commit 51f1b3a

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed

01-prerequisites.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ For the AI-enabled development portion, [Cursor](https://cursor.com/) is another
3636
choice!
3737

3838

39+
## A conda CLI ([micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html) preferred)
40+
41+
This workshop will use conda to manage and isolate dependencies.
42+
43+
We will provide commands to create your environment and install the necessary
44+
dependencies.
45+
We will use `micromamba` for all commands, but you can substitute `conda` or `mamba` and
46+
they should still work.
47+
48+
If you're using Anaconda or Miniconda,
49+
[configure `conda-forge` as your primary channel](https://conda-forge.org/docs/user/transitioning_from_defaults/).
50+
51+
You may also use [pixi](https://pixi.sh/latest/), but we expect you to be
52+
self-sufficient if you do.
53+
54+
3955
## Something to manage Python dependencies
4056

4157
**And know how to use it!**

04-materials/02-anatomy-of-extensions.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,25 @@ First we'll look at the final extension together. It:
9797

9898
## 🏋️ Exercise A (15 minutes): Extension creation and development loop
9999

100+
### Set up workshop dependency environment
101+
102+
```bash
103+
# Create an environment named "jupytercon2025"
104+
micromamba create -n jupytercon2025
105+
106+
# Activate it
107+
# IMPORTANT: Run this every time you open a new terminal!
108+
micromamba activate jupyutercon2025
109+
110+
# Install workshop dependencies
111+
## python & pip: Python language and its official package installer
112+
## nodejs: A JavaScript runtime
113+
## gh: The GitHub CLI
114+
## copier: A tool for quickstarting an extension from a template
115+
## jinja2-time: A dependency of the official JupyterLab extension template
116+
micromamba install python pip nodejs gh "copier~=9.2" jinja2-time
117+
```
118+
100119
### Create a repository in GitHub and clone it
101120

102121
0. Change to the parent directory where you want to work, e.g.
@@ -121,18 +140,7 @@ First we'll look at the final extension together. It:
121140

122141
### First, create a new extension from the [official template](https://github.com/jupyterlab/extension-template)
123142

124-
:::{important} Prerequisites
125-
* `copier`. Install with any of the following options:
126-
* Into an existing environment (don't forget to activate it first):
127-
* `pip install "copier~=9.2" jinja2-time`
128-
* `conda install -c conda-forge "copier~=9.2" jinja2-time`
129-
* Globally:
130-
* `pipx install "copier~=9.2" --preinstall jinja2-time`
131-
* `uv tool install --with jinja2-time copier~=9.2`
132-
* `pixi global install "copier~=9.2" --with jinja2-time`
133-
:::
134-
135-
2. Instantiate the template to get started on your new extension!
143+
1. Instantiate the template to get started on your new extension!
136144

137145
```bash
138146
copier copy --trust https://github.com/jupyterlab/extension-template .
@@ -147,17 +155,13 @@ First we'll look at the final extension together. It:
147155

148156
![A demo of instantiating an extension project from the official template](../assets/images/init-from-template.gif)
149157

150-
3. List out the files that were created (`ls -la` or `tree -a` are good options)
158+
2. List out the files that were created (`ls -la` or `tree -a` are good options)
151159

152-
4. Install the extension in development mode
160+
3. Install the extension in development mode
153161

154162
```bash
155-
# Create and activate a virtualenv
156-
uv venv .venv
157-
source .venv/bin/activate
158-
159163
# Install package in development mode
160-
uv pip install --editable ".[dev,test]"
164+
pip install --editable ".[dev,test]"
161165
162166
# Install the frontend and backend components of the extension in development mode:
163167
jupyter labextension develop . --overwrite
@@ -168,7 +172,7 @@ First we'll look at the final extension together. It:
168172
jlpm build
169173
```
170174

171-
5. 🧪 Test it out! Run this command in a **separate terminal**.
175+
4. 🧪 Test it out! Run this command in a **separate terminal**.
172176
It will open JupyterLab in your browser automatically.
173177
Remember to activate the virtual environment again with `source .venv/bin/activate`
174178
any time you create a new terminal.
@@ -178,7 +182,7 @@ First we'll look at the final extension together. It:
178182
jupyter lab
179183
```
180184

181-
6. Confirm the extension was loaded. Open your browser's dev console (F12 or
185+
5. Confirm the extension was loaded. Open your browser's dev console (F12 or
182186
`CTRL+SHIFT+I`) and look for log messages reading:
183187
184188
* `JupyterLab extension jupytercon2025-extension-workshop is activated!`
@@ -187,7 +191,7 @@ First we'll look at the final extension together. It:
187191
188192
**If you do not see these messages, let us know you need help!**
189193
190-
7. Directly test the server portion of the extension by visiting the endpoint in your
194+
6. Directly test the server portion of the extension by visiting the endpoint in your
191195
browser (`http://localhost:8888/jupytercon2025-extension-workshop/hello`).
192196
You should see the same message as the last step:
193197
`Hello, world! This is the '/jupytercon2025-extension-workshop/hello' endpoint. Try

0 commit comments

Comments
 (0)