Skip to content

Commit 230c069

Browse files
authored
Merge pull request #391 from mahendrapaipuri/fix_editable_install
Fix editable install and update CONTRIBUTING.md
2 parents 1bb2690 + 6089c07 commit 230c069

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ node_modules/
66
package-lock.json
77
.yarn-packages/
88
*.tsbuildinfo
9-
9+
.DS_Store
1010

1111
# Copy pasted entries from:
1212
# https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore

CONTRIBUTING.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ the README.md file.
1010
### Python package
1111

1212
```bash
13+
# Clone the repo to your local environment
14+
git clone https://github.com/jupyterhub/jupyter-server-proxy.git
15+
# Change directory to the jupyter-server-proxy directory
16+
cd jupyter-server-proxy
17+
# Install package in development mode
1318
pip install -e ".[test]"
14-
15-
# explicit install needed with editable mode (-e) jupyter
16-
jupyter serverextension enable --sys-prefix jupyter_server_proxy
17-
jupyter server extension enable --sys-prefix jupyter_server_proxy
19+
# Link your development version of the extension with JupyterLab (only for JupyterLab 3)
20+
jupyter labextension develop --overwrite .
21+
# Server extension must be manually installed in develop mode
22+
jupyter server extension enable jupyter_server_proxy
1823
```
1924

2025
Before running tests, you need a server that we can test against.
@@ -79,7 +84,22 @@ and `jupyter_server_proxy/labextension` folders:
7984

8085
```bash
8186
cd labextension
82-
jlpm watch
87+
# Watch the source directory in one terminal, automatically rebuilding when needed
88+
jlpm run watch
89+
# Run JupyterLab in another terminal
90+
jupyter lab
91+
```
92+
93+
With the watch command running, every saved change will immediately be built locally
94+
and available in your running JupyterLab. Refresh JupyterLab to load the change in
95+
your browser (you may need to wait several seconds for the extension to be rebuilt).
96+
97+
By default, the `jlpm run build` command generates the source maps for this
98+
extension to make it easier to debug using the browser dev tools. To also generate
99+
source maps for the JupyterLab core extensions, you can run the following command:
100+
101+
```bash
102+
jupyter lab build --minimize=False
83103
```
84104

85105
### Documentation

jupyter_server_proxy/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ def _jupyter_nbextension_paths():
1717
"require": "jupyter_server_proxy/tree"
1818
}]
1919

20+
def _jupyter_labextension_paths():
21+
return [{
22+
"src": "labextension",
23+
"dest": "@jupyterhub/jupyter-server-proxy",
24+
}]
25+
2026

2127
def _load_jupyter_server_extension(nbapp):
2228
# Set up handlers picked up via config

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ npm = ["jlpm"]
9797

9898
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
9999
path = "labextension"
100-
build_cmd = "install:extension"
100+
build_cmd = "build"
101101
npm = ["jlpm"]
102102
source_dir = "labextension/src"
103103
build_dir = "jupyter_server_proxy/labextension"

0 commit comments

Comments
 (0)