Skip to content

Commit 79a41ab

Browse files
authored
Merge branch 'main' into devin/1761062859-add-biome-formatter
2 parents ad994d1 + 125f95d commit 79a41ab

File tree

10 files changed

+214
-180
lines changed

10 files changed

+214
-180
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2020

2121
- name: Base Setup
22-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
2323

2424
- name: Install dependencies
2525
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
@@ -183,7 +183,7 @@ jobs:
183183
timeout-minutes: 15
184184
steps:
185185
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
186-
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
187-
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@affc83be6020d529b9368cd4d63e467877606600 # v1
186+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
187+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
188188
with:
189189
ignore_links: 'https://github.com/deepnote/jupyterlab-deepnote/pull/ https://github.com/deepnote/jupyterlab-deepnote/issues/ https://github.com/deepnote/jupyterlab-deepnote/actions/workflows/ci.yml https://github.com/deepnote/jupyterlab-deepnote/actions/workflows/ci.yml/badge.svg https://www.youtube.com/watch?v=jF0yA-JLQW0'

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
scope: '@deepnote'
2929
always-auth: true
3030
- name: Base Setup
31-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
31+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
3232

3333
- name: Check Release
3434
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@6accaa3c07b69acaa1e14e00ba138133d8cbe879 # v2

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2323

2424
- name: Base Setup
25-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
25+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
2626

2727
- name: Install JupyterLab
2828
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fetch-depth: 0
2929

3030
- name: Install qlty
31-
uses: qltysh/qlty-action/install@a19242102d17e497f437d7466aa01b528537e899
31+
uses: qltysh/qlty-action/install@92420f3093ba65970fed22ce5f162ecb8a5c1700
3232

3333
- name: Run qlty check
3434
run: qlty check
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4646

4747
- name: Base Setup
48-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
48+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
4949

5050
- name: Install dependencies
5151
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
@@ -69,7 +69,7 @@ jobs:
6969
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
7070

7171
- name: Base Setup
72-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
72+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
7373

7474
- name: Install dependencies
7575
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
@@ -93,7 +93,7 @@ jobs:
9393
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
9494

9595
- name: Base Setup
96-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
96+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
9797

9898
- name: Install dependencies
9999
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
@@ -115,7 +115,7 @@ jobs:
115115
- name: Checkout
116116
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
117117
- name: Base Setup
118-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
118+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
119119

120120
- name: Check licenses
121121
run: yarn check-licenses

.github/workflows/prep-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
permissions:
3030
contents: write
3131
steps:
32-
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
32+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
3333

3434
- name: Prep Release
3535
id: prep-release

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
permissions:
2020
id-token: write
2121
steps:
22-
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
22+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
2323

2424
- uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2
2525
id: app-token

.github/workflows/update-integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
fi
7070
7171
- name: Base Setup
72-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@affc83be6020d529b9368cd4d63e467877606600 # v1
72+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
7373

7474
- name: Install dependencies
7575
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
@@ -80,7 +80,7 @@ jobs:
8080
jlpm
8181
python -m pip install .
8282
83-
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@affc83be6020d529b9368cd4d63e467877606600 # v1
83+
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@d72f5cb72b472c1e59036840891e918c9bda4dae # v1
8484
with:
8585
github_token: ${{ secrets.GITHUB_TOKEN }}
8686
# Playwright knows how to start JupyterLab server

CONTRIBUTING.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Scope
2+
3+
This document is intended for contributors and maintainers working on the extension's source code. For general usage and installation instructions, please refer to the README.
4+
5+
# Contributing to `jupyterlab-deepnote`
6+
7+
## Development install
8+
9+
Note: You will need NodeJS to build the extension package.
10+
11+
Use any Python environment and dependency manager you like, for example [uv](https://docs.astral.sh/uv/getting-started/installation/):
12+
13+
```shell
14+
curl -LsSf https://astral.sh/uv/install.sh | sh
15+
```
16+
17+
Create a Python environment in the project directory:
18+
19+
```shell
20+
uv venv --python 3.12 --managed-python
21+
```
22+
23+
Activate the Python environment:
24+
25+
```shell
26+
source .venv/bin/activate
27+
```
28+
29+
Install `jupyterlab`. The extension package itself doesn’t depend on `jupyterlab`, you just need `jupyterlab` in the environment where you will be testing the extension.
30+
31+
```shell
32+
uv pip install jupyterlab
33+
```
34+
35+
### Configure Access to @deepnote/blocks Package
36+
37+
The `@deepnote/blocks` package is published on GitHub Packages. To install it, you'll need to authenticate with GitHub:
38+
39+
1. Create a GitHub Personal Access Token (classic) with `read:packages` scope:
40+
- Go to https://github.com/settings/tokens
41+
- Click "Generate new token (classic)"
42+
- Select the `read:packages` scope
43+
- Generate and copy the token
44+
45+
2. Set the `GITHUB_TOKEN` environment variable to ensure `jlpm` (which is a wrapper around Yarn) can download the `@deepnote/blocks` package from the GitHub package registry. You can export the variable in `.zshrc` (or by reading a `~/.env` file):
46+
```shell
47+
export GITHUB_TOKEN=your_token_here
48+
```
49+
Replace `YOUR_TOKEN_HERE` with your actual token.
50+
51+
Install the extension package in editable mode. It installs the package’s dependencies, too:
52+
53+
```shell
54+
uv pip install --editable . --verbose
55+
```
56+
57+
Link your development version of the extension with JupyterLab:
58+
59+
```shell
60+
jupyter labextension develop . --overwrite
61+
```
62+
63+
Enable the extension in Jupyter Server:
64+
65+
```shell
66+
jupyter server extension enable jupyterlab_deepnote
67+
```
68+
69+
Rebuild the extension’s Typescript source after making changes:
70+
71+
```shell
72+
jlpm run watch
73+
```
74+
75+
The `jlpm` command is JupyterLab's pinned version of
76+
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
77+
`yarn` or `npm` instead of `jlpm` below.
78+
79+
In a separate terminal, run `jupyter lab`. You can add the `--debug` option to see HTTP requests in the logs, which can be helpful for debugging.
80+
81+
```shell
82+
jupyter lab --debug
83+
```
84+
85+
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
86+
87+
```bash
88+
# Watch the source directory in one terminal, automatically rebuilding when needed
89+
jlpm watch
90+
# Run JupyterLab in another terminal
91+
jupyter lab
92+
```
93+
94+
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
95+
96+
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
97+
98+
```bash
99+
jupyter lab build --minimize=False
100+
```
101+
102+
## Development uninstall
103+
104+
```bash
105+
# Server extension must be manually disabled in develop mode
106+
jupyter server extension disable jupyterlab_deepnote
107+
pip uninstall jupyterlab_deepnote
108+
```
109+
110+
In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
111+
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
112+
folder is located. Then you can remove the symlink named `jupyterlab-deepnote` within that folder.
113+
114+
## Testing the extension
115+
116+
### Server tests
117+
118+
This extension is using [Pytest](https://docs.pytest.org/) for Python code testing.
119+
120+
Install test dependencies (needed only once):
121+
122+
```sh
123+
pip install -e ".[test]"
124+
# Each time you install the Python package, you need to restore the front-end extension link
125+
jupyter labextension develop . --overwrite
126+
```
127+
128+
To execute them, run:
129+
130+
```sh
131+
pytest -vv -r ap --cov jupyterlab_deepnote
132+
```
133+
134+
### Frontend tests
135+
136+
This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
137+
138+
To execute them, execute:
139+
140+
```sh
141+
jlpm
142+
jlpm test
143+
```
144+
145+
## Versioning and compatibility
146+
147+
We follow [Semantic Versioning (semver)](https://semver.org/).
148+
149+
The extension pins JupyterLab to the current major version in both Python and JavaScript dependencies to ensure compatibility.
150+
151+
**Example `pyproject.toml` dependency:**
152+
153+
```toml
154+
[project.optional-dependencies]
155+
jupyterlab = ["jupyterlab>=4.0.0,<5.0.0"]
156+
```
157+
158+
**Example `package.json` peerDependencies:**
159+
160+
```json
161+
"peerDependencies": {
162+
"@jupyterlab/application": "^4.0.0",
163+
"@jupyterlab/apputils": "^4.0.0",
164+
"jupyterlab": "^4.0.0"
165+
}
166+
```
167+
168+
## Sync with the JupyterLab extension template
169+
170+
This project was bootstrapped using the [JupyterLab extension template](https://github.com/jupyterlab/extension-template). To keep your project up to date with improvements and best practices from the template, run:
171+
172+
```sh
173+
copier update --trust
174+
```
175+
176+
This will apply the latest template changes interactively. Review and commit any updates as appropriate.
177+
178+
## Release workflow
179+
180+
See [RELEASE](RELEASE.md) for details on the release process. We recommend using [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser) and [PyPI trusted publishing](https://docs.pypi.org/trusted-publishers/) for secure and automated releases.

0 commit comments

Comments
 (0)