Skip to content

Commit 3079f65

Browse files
committed
feat: add jupyterlab 2 backwards compatibility
1 parent ef98ed2 commit 3079f65

File tree

7 files changed

+224
-193
lines changed

7 files changed

+224
-193
lines changed

Dockerfile

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
FROM python
2+
3+
24
RUN pip install jupyterlab~=3.0
3-
# COPY dist/jupyterlab_s3_browser-0.8.0.dev9-py3-none-any.whl .
4-
# RUN pip install jupyterlab_s3_browser-0.8.0.dev9-py3-none-any.whl
5-
RUN pip install jupyterlab-s3-browser==0.8.0
5+
# RUN pip install jupyterlab==2.2.9
6+
7+
8+
# COPY dist/jupyterlab_s3_browser-0.9.0.dev1-py3-none-any.whl .
9+
# RUN pip install jupyterlab_s3_browser-0.9.0.dev1-py3-none-any.whl
10+
RUN pip install jupyterlab-s3-browser==0.9.0.dev1
11+
12+
13+
# RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
14+
# RUN apt-get -y install nodejs
15+
# RUN jupyter labextension install jupyterlab-s3-browser@0.9.0-dev.0
16+
RUN jupyter serverextension enable --py jupyterlab_s3_browser

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ A JupyterLab extension for browsing S3-compatible object storage.
1212
pip install jupyterlab-s3-browser
1313
```
1414

15+
You may also need to run:
16+
17+
```
18+
jupyter serverextension enable --py jupyterlab_s3_browser
19+
```
20+
21+
to make sure the serverextension is enabled and then restart (stop and start) JupyterLab.
22+
1523
### JupyterLab 2
1624

1725
```bash

jupyterlab_s3_browser/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ def _load_jupyter_server_extension(server_app):
5454
setup_handlers(server_app.web_app)
5555

5656

57+
# backwards compatibility with jupyterlab 2.0
5758
load_jupyter_server_extension = _load_jupyter_server_extension
59+
_jupyter_server_extension_paths = _jupyter_server_extension_points

package.json

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-s3-browser",
3-
"version": "0.8.0",
3+
"version": "0.9.0-dev.1",
44
"description": "JupyterLab extension for browsing S3-compatible object storage",
55
"keywords": [
66
"s3",
@@ -54,29 +54,28 @@
5454
"watch:labextension": "jupyter labextension watch ."
5555
},
5656
"dependencies": {
57-
"@jupyterlab/application": "^3.0.0",
58-
"@jupyterlab/apputils": "^3.0.0",
59-
"@jupyterlab/coreutils": "^5.0.0",
60-
"@jupyterlab/docmanager": "^3.0.0",
61-
"@jupyterlab/docregistry": "^3.0.0",
62-
"@jupyterlab/filebrowser": "^3.0.0",
63-
"@jupyterlab/services": "^6.0.0",
64-
"@jupyterlab/settingregistry": "^3.0.0",
57+
"@jupyterlab/application": "^2.0.0 || ^3.0.0",
58+
"@jupyterlab/apputils": "^2.0.0 || ^3.0.0",
59+
"@jupyterlab/coreutils": "^4.0.0 || ^5.0.0",
60+
"@jupyterlab/docmanager": "^2.0.0 || ^3.0.0",
61+
"@jupyterlab/docregistry": "^2.0.0 || ^3.0.0",
62+
"@jupyterlab/filebrowser": "^2.0.0 || ^3.0.0",
63+
"@jupyterlab/services": "^5.0.0 || ^6.0.0",
64+
"@jupyterlab/settingregistry": "^2.0.0 || ^3.0.0",
6565
"@lumino/algorithm": "^1.2.3",
6666
"@lumino/messaging": "^1.3.3",
6767
"@lumino/signaling": "^1.3.5",
68-
"@lumino/widgets": "^1.17.0",
6968
"@typescript-eslint/eslint-plugin": "^4.14.1",
7069
"@typescript-eslint/parser": "^4.14.1",
7170
"base64-js": "^1.2.3",
7271
"eslint": "^7.18.0",
7372
"eslint-config-prettier": "^7.2.0",
7473
"eslint-plugin-prettier": "^3.3.1",
7574
"eslint-plugin-react": "^7.22.0",
76-
"react": "^17.0.0"
75+
"react": "^16.0.0 || ^17.0.0"
7776
},
7877
"devDependencies": {
79-
"@jupyterlab/builder": "^3.0.1",
78+
"@jupyterlab/builder": "^2.0.0 || ^3.0.1",
8079
"@types/base64-js": "^1.2.5",
8180
"@types/text-encoding": "^0.0.32",
8281
"husky": "^0.14.3",

setup.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
4141
(
4242
"etc/jupyter/jupyter_server_config.d",
43-
"jupyter-config",
43+
"jupyter-config/jupyter_server_config.d",
44+
"jupyterlab_s3_browser.json",
45+
),
46+
(
47+
"etc/jupyter/jupyter_notebook_config.d",
48+
"jupyter-config/jupyter_notebook_config.d",
4449
"jupyterlab_s3_browser.json",
4550
),
4651
]
@@ -85,7 +90,13 @@
8590
"Programming Language :: Python :: 3",
8691
"Framework :: Jupyter",
8792
],
88-
install_requires=["notebook", "boto3", "singleton-decorator", "jupyterlab>=3.0.0"],
93+
install_requires=[
94+
"notebook",
95+
"boto3",
96+
"jupyter_server",
97+
"singleton-decorator",
98+
"jupyterlab>=2.0.0",
99+
],
89100
extras_require={"dev": ["jupyter_packaging~=0.7.9", "pytest", "moto", "coverage"]},
90101
)
91102

src/contents.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ namespace Private {
371371

372372
export const availableContentTypes: any = {};
373373
export let currentPath: string;
374-
export const showingError = false;
374+
export let showingError = false;
375375

376376
export function showErrorMessage(message: string): void {
377377
Private.hideDirectoryLoadingSpinner();

0 commit comments

Comments
 (0)