Skip to content

Commit e53ce8f

Browse files
jtpiofcollonval
andauthored
Update to JupyterLab 3 and jupyter server (#111)
* Port to JupyterLab 3 * Clean up and restore co-author Co-authored-by: Jeremy Tuloup <[email protected]> * Port binder to JLab3 * Deactivate coveralls * Fix proxied server Co-authored-by: Frederic COLLONVAL <[email protected]>
1 parent f73b8af commit e53ce8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3504
-46540
lines changed

.github/workflows/build.yml

+26-37
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
run: |
4141
conda activate test_gator
4242
conda install -n test_gator --file requirements_dev.txt
43-
pip install .
43+
python setup.py develop --skip-npm
44+
# Check pip dependencies
45+
python -m pip check
4446
shell: bash -l {0}
4547
- name: Test the server extension
4648
run: |
@@ -75,18 +77,16 @@ jobs:
7577
activate-environment: test_gator
7678
auto-update-conda: true
7779
channels: conda-forge
78-
mamba-version: "*"
7980
python-version: ${{ matrix.python-version }}
8081
show-channel-urls: true
8182
use-only-tar-bz2: true
8283
- name: Install dependencies
8384
run: |
8485
conda activate test_gator
85-
mamba install -n test_gator --file requirements_dev.txt
86-
conda install -n test_gator jupyterlab=2
87-
pip install .
86+
conda install -n test_gator --file requirements_dev.txt
87+
python setup.py develop --skip-npm
8888
# Check pip dependencies
89-
pip check
89+
python -m pip check
9090
shell: bash -l {0}
9191
- name: Test the server extension
9292
run: |
@@ -152,12 +152,9 @@ jobs:
152152
run: |
153153
conda activate test_gator
154154
conda install -n test_gator --file requirements_dev.txt
155-
conda install -n test_gator jupyterlab=2
156-
yarn install
157-
pip install .
158-
155+
conda install -n test_gator jupyterlab=3
159156
yarn install
160-
jupyter labextension link packages/common/ packages/labextension/
157+
python -m pip install -e .
161158
shell: bash -l {0}
162159

163160
- name: Test the extension
@@ -223,12 +220,11 @@ jobs:
223220
run: |
224221
conda activate test_gator
225222
mamba install -n test_gator --file requirements_dev.txt
226-
conda install -n test_gator coveralls jupyterlab=2
223+
conda install -n test_gator coveralls jupyterlab=3
227224
yarn install
228-
pip install .
225+
python -m pip install -e .
229226
# Check pip dependencies
230227
pip check
231-
jupyter labextension link packages/common/ packages/labextension/
232228
shell: bash -l {0}
233229

234230
- name: Test the extension
@@ -249,27 +245,20 @@ jobs:
249245
cat labextensions | grep "@mamba-org/gator-lab.*OK"
250246
python -m jupyterlab.browser_check
251247
shell: bash -l {0}
252-
# - name: Integration tests
253-
# run: |
254-
# chmod -R a+rx ./e2e-tests
255-
# docker-compose -f "docker-compose.yml" run e2e ./e2e-tests/run_e2e.sh
256-
# - name: Stop containers
257-
# if: always()
258-
# run: docker-compose -f "docker-compose.yml" down
259248

260-
- name: Install Ruby
261-
uses: ruby/setup-ruby@v1
262-
with:
263-
ruby-version: 2.6
264-
- name: Upload coverage
265-
env:
266-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
267-
run: |
268-
conda activate test_gator
269-
gem install coveralls-lcov
270-
pushd packages/common/
271-
coveralls-lcov -v -n coverage/lcov.info > ../../common-jscoverage.json
272-
popd
273-
python -m pip install --upgrade coveralls
274-
python -m coveralls --merge=common-jscoverage.json
275-
shell: bash -l {0}
249+
# - name: Install Ruby
250+
# uses: ruby/setup-ruby@v1
251+
# with:
252+
# ruby-version: 2.6
253+
# - name: Upload coverage
254+
# env:
255+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
256+
# run: |
257+
# conda activate test_gator
258+
# gem install coveralls-lcov
259+
# pushd packages/common/
260+
# coveralls-lcov -v -n coverage/lcov.info > ../../common-jscoverage.json
261+
# popd
262+
# python -m pip install --upgrade coveralls
263+
# python -m coveralls --merge=common-jscoverage.json
264+
# shell: bash -l {0}

.lintstagedrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"packages/**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}": [
2+
"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}": [
33
"prettier --write",
44
"git add"
55
]
66
}
7-

.prettierignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
node_modules
22
**/node_modules
33
**/lib
4-
**/build
5-
**/static
6-
mamba_gator/navigator
4+
**/package.json
5+
mamba_gator

.prettierrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
35
}

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include tsconfig.json
1212
include tsconfig-base.json
1313
include eslint-base.js
1414
graft packages
15+
graft mamba_gator/labextension
1516
prune packages/**/coverage
1617
prune packages/**/lib
1718
prune packages/**/build

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ The Mamba Navigator, a Web UI for managing conda environments
99
[![Coverage Status](https://coveralls.io/repos/github/mamba-org/gator/badge.svg?branch=master)](https://coveralls.io/github/mamba-org/gator?branch=master)
1010
[![Swagger Validator](https://img.shields.io/swagger/valid/3.0?specUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fmamba-org%2Fgator%2Fmaster%2Fmamba_gator%2Frest_api.yml)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/mamba-org/gator/master/mamba_gator/rest_api.yml)
1111

12-
Provides Conda/Mamba environment and package management as a [standalone application](#Navigator) or as extension for [Jupyter Notebook](#Classical-Jupyter-Notebook) and [JupyterLab](#JupyterLab).
12+
Provides Conda/Mamba environment and package management as a [standalone application](#Navigator) or as extension for [JupyterLab](#JupyterLab).
1313

1414
## Install
1515

1616
_Requirements_
1717

1818
- conda >= 4.5 or mamba >=0.5
19-
- notebook >= 4.3
20-
- JupyterLab 2.x (for the jupyterlab extension only)
19+
- JupyterLab 1.x, 2.x or 3.x (for the JupyterLab extension only)
2120

2221
> Starting from 3.4, this extension will use [mamba](https://github.com/mamba-org/mamba) instead of `conda` if it finds it.
2322
@@ -31,6 +30,11 @@ To install in the JupyterLab:
3130

3231
```shell
3332
conda install -c conda-forge jupyterlab mamba_gator
33+
```
34+
35+
If you use JupyterLab 1.x or 2.x, you can install the extension with the following command:
36+
37+
```shell
3438
jupyter labextension install @mamba-org/gator-lab
3539
```
3640

@@ -61,11 +65,7 @@ Open JupyterLab: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybind
6165

6266
## Classical Jupyter Notebook
6367

64-
This extension adds a _Conda_ tab to the Jupyter file browser and a _Conda Packages_ item
65-
to the _Kernel_ menu.
66-
Clicking on either of those elements will open the standalone navigator in a new tab.
67-
68-
![Classical Notebook integration](packages/navigator/classical_nb_integration.gif)
68+
The classical Jupyter Notebook is supported only for version prior to 4.1.
6969

7070
## Creating New Environments
7171

@@ -86,12 +86,10 @@ There are three ways to create an environment:
8686
## Development
8787

8888
```shell
89-
conda create -c conda-forge -y -n gator python jupyterlab=2
89+
conda create -c conda-forge -y -n gator python jupyterlab=3
9090
conda install -c conda-forge -y -n gator --file requirements_dev.txt
9191
conda activate gator
9292
pip install -e .
93-
jupyter nbextension install mamba_gator --py --sys-prefix --symlink
94-
jupyter nbextension enable mamba_gator --py --sys-prefix
9593
jupyter serverextension enable mamba_gator --py --sys-prefix
9694

9795
yarn install

binder/environment.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ channels:
22
- conda-forge
33
dependencies:
44
- python >=3.6,<3.9
5-
- jupyterlab =2
5+
- jupyterlab =3
6+
- jupyter-packaging >=0.7.9,<0.8.0
67
- jupyter-server-proxy
78
- nb_conda_kernels >=2.2.3
8-
- nodejs >=11
9+
- nodejs >=14
910
- yarn
1011
- notebook >=4.3.1
1112
- packaging

binder/jupyter_notebook_config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"--no-browser",
1010
'--port={port}',
1111
"--ip=0.0.0.0",
12-
"--NotebookApp.token=''",
13-
"--NotebookApp.base_url={base_url}mamba",
14-
"--NotebookApp.allow_remote_access=True",
12+
"--ServerApp.token=''",
13+
"--ServerApp.base_url={base_url}mamba",
14+
"--ServerApp.allow_remote_access=True",
1515
],
1616
"timeout": 120,
1717
"absolute_url": True,

binder/postBuild

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ set -eux
55
yarn install
66
yarn run build
77
python -m pip install .
8+
python -m pip install jupyterlab-tour
89

9-
# !! Be sure the version of jupyterlab-tour matches the one saved in bind/workspace.json
10-
jupyter labextension install jupyterlab-tour@^2.1.1 @jupyterlab/server-proxy --no-build
11-
jupyter labextension link packages/common/ packages/labextension --no-build
10+
jupyter labextension install @jupyterlab/server-proxy --no-build
1211
jupyter lab build --minimize=False
1312

1413
# Import the workspace into JupyterLab

binder/workspace.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"jupyterlab-tour:state": {
2727
"tutorialsDone": ["jupyterlab-tour:welcome"],
28-
"version": "2.1.1"
28+
"version": "3.0.0"
2929
},
3030
"conda-env:conda-env": { "data": {} }
3131
},

e2e-tests/Dockerfile

-5
This file was deleted.

e2e-tests/conftest.py

-34
This file was deleted.

0 commit comments

Comments
 (0)