Skip to content

Commit 7f0bd58

Browse files
committed
docs: mv local dev setup to CONTRIBUTING.md and document tests
1 parent 710f0b3 commit 7f0bd58

File tree

3 files changed

+68
-46
lines changed

3 files changed

+68
-46
lines changed

.github/workflows/test.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
python-version: "${{ matrix.python }}"
5050

5151
- name: Install Python dependencies
52+
# NOTE: See CONTRIBUTING.md for a local development setup that differs
53+
# slightly from this.
5254
run: |
5355
pip install --upgrade pip
5456
pip install .

CONTRIBUTING.md

+64
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
11
# Contributing
22

33
Welcome! As a [Jupyter](https://jupyter.org) project, we follow the [Jupyter contributor guide](https://jupyter.readthedocs.io/en/latest/contributor/content-contributor.html).
4+
5+
To setup a local development environment and ru tests, see the small section in
6+
the README.md file.
7+
8+
## Local development setup
9+
10+
### Python package
11+
12+
```bash
13+
pip install -e .
14+
15+
# explicit install needed with editable mode (-e) jupyter
16+
jupyter serverextension enable --sys-prefix jupyter_server_proxy
17+
```
18+
19+
Before running tests, you need a [notebook
20+
server](https://github.com/jupyter/notebook) that we can test against.
21+
22+
```
23+
JUPYTER_TOKEN=secret jupyter-notebook --config=./tests/resources/jupyter_server_config.py
24+
```
25+
26+
Run the tests:
27+
28+
```
29+
pytest --verbose
30+
```
31+
32+
### JupyterLab extension
33+
34+
The `jlpm` command is JupyterLab's pinned version of `yarn` that is
35+
installed with JupyterLab. You may use `yarn` or `npm` instead of `jlpm`
36+
below.
37+
38+
```bash
39+
cd jupyterlab-server-proxy
40+
41+
# Install dependencies
42+
jlpm
43+
44+
# Build Typescript source
45+
jlpm build
46+
47+
# Link your development version of the extension with JupyterLab
48+
jupyter labextension link .
49+
50+
# Rebuild Typescript source after making changes
51+
jlpm build
52+
53+
# Rebuild JupyterLab after making any changes
54+
jupyter lab build
55+
```
56+
57+
You can watch the source directory and run JupyterLab in watch mode to
58+
watch for changes in the extension's source and automatically rebuild
59+
the extension and application.
60+
61+
```bash
62+
# Watch the source directory in another terminal tab
63+
jlpm watch
64+
65+
# Run jupyterlab in watch mode in one terminal tab
66+
jupyter lab --watch
67+
```

README.md

+2-46
Original file line numberDiff line numberDiff line change
@@ -58,50 +58,6 @@ requires the python package to be installed.
5858
jupyter labextension install @jupyterlab/server-proxy
5959
```
6060

61-
## Contributing
61+
## Local development
6262

63-
### Python package
64-
65-
```
66-
pip install -e .
67-
68-
# explicit install needed with editable mode (-e) jupyter
69-
jupyter serverextension enable --sys-prefix jupyter_server_proxy
70-
```
71-
72-
### JupyterLab extension
73-
74-
The `jlpm` command is JupyterLab's pinned version of `yarn` that is
75-
installed with JupyterLab. You may use `yarn` or `npm` instead of `jlpm`
76-
below.
77-
78-
```
79-
cd jupyterlab-server-proxy
80-
81-
# Install dependencies
82-
jlpm
83-
84-
# Build Typescript source
85-
jlpm build
86-
87-
# Link your development version of the extension with JupyterLab
88-
jupyter labextension link .
89-
90-
# Rebuild Typescript source after making changes
91-
jlpm build
92-
93-
# Rebuild JupyterLab after making any changes
94-
jupyter lab build
95-
```
96-
97-
You can watch the source directory and run JupyterLab in watch mode to
98-
watch for changes in the extension's source and automatically rebuild
99-
the extension and application.
100-
101-
```
102-
# Watch the source directory in another terminal tab
103-
jlpm watch
104-
105-
# Run jupyterlab in watch mode in one terminal tab
106-
jupyter lab --watch
107-
```
63+
See [CONTRIBUTING.md].

0 commit comments

Comments
 (0)