Skip to content

Commit b42ae8d

Browse files
committed
Update for JupyterLab 3
Signed-off-by: martinRenou <[email protected]>
1 parent 1ccaf45 commit b42ae8d

File tree

14 files changed

+3484
-7725
lines changed

14 files changed

+3484
-7725
lines changed

.github/workflows/main.yml

Lines changed: 117 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,147 @@ on:
88
branches:
99
- master
1010

11-
jobs:
11+
defaults:
1212
run:
13+
shell: bash -l {0}
14+
15+
jobs:
16+
tests:
1317
runs-on: ${{ matrix.os }}
1418

1519
strategy:
1620
fail-fast: false
1721
matrix:
18-
os: [ubuntu-latest, macos-latest, windows-latest]
19-
python-version: [3.6, 3.7, 3.8]
22+
os: [ubuntu-latest, macos-latest]
23+
python-version: [3.9]
2024

2125
steps:
2226
- name: Checkout
2327
uses: actions/checkout@v2
2428

2529
- name: Setup conda
26-
uses: s-weigand/setup-conda@v1
30+
uses: conda-incubator/setup-miniconda@v2
2731
with:
28-
auto-update-conda: true
29-
update-conda: true
30-
conda-channels: conda-forge
32+
activate-environment: ipygany-dev
33+
environment-file: dev_environment.yml
34+
python-version: ${{ matrix.python-version }}
35+
mamba-version: "*"
36+
auto-activate-base: false
37+
channels: conda-forge
3138

32-
- name: Conda install dependencies
33-
run: conda install python=${{ matrix.python-version }} pip nodejs=13 ipywidgets jupyter jupyterlab vtk flake8 pytest ipydatawidgets
39+
- name: Workaround pytest issue
40+
run: pip install pytest_tornasync
3441

3542
- name: Test flake8
3643
run: flake8 ipygany --ignore=E501
3744

3845
- name: Install ipygany
39-
run: pip install -e .
46+
run: pip install .
47+
48+
- name: Check installation files
49+
run: |
50+
test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipygany
51+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/extension.js
52+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/index.js
53+
test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany
54+
test -f $CONDA_PREFIX/share/jupyter/labextensions/ipygany/package.json
4055
41-
- name: Install labextension (Only on Ubuntu for build speed)
42-
if: matrix.os == 'ubuntu-latest'
43-
run: jupyter labextension install .
56+
- name: Check nbextension and labextension
57+
run: |
58+
jupyter nbextension list 2>&1 | grep -ie "ipygany/extension.*enabled" -
59+
jupyter labextension list 2>&1 | grep -ie "ipygany.*enabled.*ok" -
4460
4561
- name: Run Python tests
4662
run: pytest tests
4763

4864
- name: Build docs (Only on MacOS for build speed)
4965
if: matrix.os == 'macos-latest'
5066
run: |
51-
conda install sphinx sphinx_rtd_theme pygments==2.6.1 jupyter-sphinx meshpy pyvista
52-
cd docs/source/
53-
sphinx-build . _build/html
54-
cd ../..
67+
mamba install sphinx sphinx_rtd_theme pygments==2.6.1 jupyter-sphinx meshpy pyvista
68+
cd docs/source/
69+
sphinx-build . _build/html
70+
cd ../..
71+
72+
build:
73+
runs-on: ubuntu-latest
74+
steps:
75+
76+
- name: Checkout
77+
uses: actions/checkout@v2
78+
79+
- name: Setup conda
80+
uses: conda-incubator/setup-miniconda@v2
81+
with:
82+
activate-environment: ipygany-dev
83+
environment-file: dev_environment.yml
84+
python-version: ${{ matrix.python-version }}
85+
mamba-version: "*"
86+
auto-activate-base: false
87+
channels: conda-forge
88+
89+
- name: Build packages
90+
run: |
91+
python setup.py sdist bdist_wheel
92+
cd dist
93+
sha256sum * | tee SHA256SUMS
94+
95+
- name: Upload builds
96+
uses: actions/upload-artifact@v2
97+
with:
98+
name: dist ${{ github.run_number }}
99+
path: ./dist
100+
101+
install:
102+
runs-on: ${{ matrix.os }}-latest
103+
needs: [build]
104+
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
os: [ubuntu, macos, windows]
109+
python: ['3.6', '3.9']
110+
include:
111+
- python: '3.6'
112+
dist: 'ipygany*.tar.gz'
113+
- python: '3.9'
114+
dist: 'ipygany*.whl'
115+
116+
steps:
117+
118+
- name: Checkout
119+
uses: actions/checkout@v2
120+
121+
- name: Setup conda
122+
uses: conda-incubator/setup-miniconda@v2
123+
with:
124+
activate-environment: ipygany-dev
125+
environment-file: dev_environment.yml
126+
python-version: ${{ matrix.python-version }}
127+
mamba-version: "*"
128+
auto-activate-base: false
129+
channels: conda-forge
130+
131+
- uses: actions/download-artifact@v2
132+
with:
133+
name: dist ${{ github.run_number }}
134+
path: ./dist
135+
136+
- name: Install the package
137+
run: |
138+
cd dist
139+
pip install -vv ${{ matrix.dist }}
140+
141+
- name: Test installation files
142+
run: |
143+
test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipygany
144+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/extension.js
145+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipygany/index.js
146+
test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany
147+
test -f $CONDA_PREFIX/share/jupyter/labextensions/ipygany/package.json
148+
test -d $CONDA_PREFIX/share/jupyter/labextensions/ipygany/static
149+
150+
- name: Validate the nbextension
151+
run: jupyter nbextension list 2>&1 | grep "ipygany/extension"
152+
153+
- name: Validate the labextension
154+
run: jupyter labextension list 2>&1 | grep ipygany

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ $RECYCLE.BIN/
146146

147147
**/node_modules/
148148
ipygany/nbextension/static/index.*
149-
ipygany/labextension/*.tgz
149+
ipygany/labextension/*
150150

151151
# Coverage data
152152
# -------------

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ include .coverage.rc
88
include tsconfig.json
99
include package.json
1010
include webpack.config.js
11-
include ipygany/labextension/*.tgz
1211

1312
# Documentation
1413
graft docs
@@ -26,6 +25,7 @@ prune tests/build
2625

2726
# Javascript files
2827
graft ipygany/nbextension
28+
graft ipygany/labextension
2929
graft src
3030
graft css
3131
prune **/node_modules

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ If you want to load vtk files in `ipygany`, you also need to install vtk, you ca
6868
conda install -c conda-forge vtk
6969
```
7070

71-
For JupyterLab
72-
--------------
71+
For JupyterLab <= 2
72+
-------------------
7373

7474
You need to install the labextension for **ipygany**:
7575

dev_environment.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: ipygany-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- pip
6+
- yarn
7+
- jupyter-packaging
8+
- jupyterlab=3
9+
- ipywidgets>=7.6
10+
- vtk
11+
- flake8
12+
- pytest
13+
- ipydatawidgets

0 commit comments

Comments
 (0)