Skip to content

Commit 4fd1445

Browse files
authored
Merge pull request #174 from martinRenou/yarn
Use yarn, and fix JupyterLab 2 support
2 parents 96064b7 + 3622504 commit 4fd1445

File tree

8 files changed

+3521
-12662
lines changed

8 files changed

+3521
-12662
lines changed

.github/workflows/main.yml

Lines changed: 101 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ on:
88
branches:
99
- master
1010

11+
defaults:
12+
run:
13+
shell: bash -l {0}
14+
1115
jobs:
1216
run:
1317
runs-on: ${{ matrix.os }}
1418

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

2125
steps:
2226
- name: Checkout
@@ -25,19 +29,17 @@ jobs:
2529
- name: Setup conda
2630
uses: conda-incubator/setup-miniconda@v2
2731
with:
32+
activate-environment: ipycanvas-dev
33+
environment-file: dev-environment.yml
34+
python-version: ${{ matrix.python-version }}
2835
mamba-version: "*"
36+
auto-activate-base: false
2937
channels: conda-forge
3038

31-
- name: Mamba install dependencies
32-
shell: bash -l {0}
33-
run: mamba install python=${{ matrix.python-version }} pip nodejs ipywidgets=7.6 jupyter jupyterlab=3 pillow numpy flake8
34-
3539
- name: Install ipycanvas
36-
shell: bash -l {0}
3740
run: pip install -e .
3841

3942
- name: Check installation files
40-
shell: bash -l {0}
4143
run: |
4244
test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipycanvas
4345
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipycanvas/extension.js
@@ -46,11 +48,100 @@ jobs:
4648
test -f $CONDA_PREFIX/share/jupyter/labextensions/ipycanvas/package.json
4749
4850
- name: Check nbextension and labextension
49-
shell: bash -l {0}
5051
run: |
5152
jupyter nbextension list 2>&1 | grep -ie "ipycanvas/extension.*enabled" -
5253
jupyter labextension list 2>&1 | grep -ie "ipycanvas.*enabled.*ok" -
5354
5455
- name: Test flake8
55-
shell: bash -l {0}
5656
run: flake8 ipycanvas --ignore=E501,W504,W503
57+
58+
build:
59+
runs-on: ubuntu-latest
60+
steps:
61+
62+
- name: Checkout
63+
uses: actions/checkout@v2
64+
65+
- name: Setup conda
66+
uses: conda-incubator/setup-miniconda@v2
67+
with:
68+
activate-environment: ipycanvas-dev
69+
environment-file: dev-environment.yml
70+
python-version: ${{ matrix.python-version }}
71+
mamba-version: "*"
72+
auto-activate-base: false
73+
channels: conda-forge
74+
75+
- name: Build packages
76+
run: |
77+
python setup.py sdist bdist_wheel
78+
cd dist
79+
sha256sum * | tee SHA256SUMS
80+
81+
- name: Upload builds
82+
uses: actions/upload-artifact@v2
83+
with:
84+
name: dist ${{ github.run_number }}
85+
path: ./dist
86+
87+
install:
88+
runs-on: ${{ matrix.os }}-latest
89+
needs: [build]
90+
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
os: [ubuntu, macos]
95+
python: ['3.6', '3.9']
96+
include:
97+
- python: '3.6'
98+
dist: 'ipycanvas*.tar.gz'
99+
jlab_version: 3
100+
- python: '3.9'
101+
dist: 'ipycanvas*.whl'
102+
jlab_version: 2
103+
104+
steps:
105+
106+
- name: Checkout
107+
uses: actions/checkout@v2
108+
109+
- name: Setup conda
110+
uses: conda-incubator/setup-miniconda@v2
111+
with:
112+
python-version: ${{ matrix.python-version }}
113+
mamba-version: "*"
114+
auto-activate-base: false
115+
channels: conda-forge
116+
117+
- name: Install dependencies
118+
run: mamba install python=${{ matrix.python-version }} pip yarn jupyterlab=${{ matrix.jlab_version }} ipywidgets jupyter-packaging
119+
120+
- uses: actions/download-artifact@v2
121+
with:
122+
name: dist ${{ github.run_number }}
123+
path: ./dist
124+
125+
- name: Install the package
126+
run: |
127+
cd dist
128+
pip install -vv ${{ matrix.dist }}
129+
130+
- name: Manually install labextension for lab2
131+
if: ${{ matrix.jlab_version }} == 2
132+
run: jupyter labextension install .
133+
134+
- name: Test installation files
135+
run: |
136+
test -d $CONDA_PREFIX/share/jupyter/nbextensions/ipycanvas
137+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipycanvas/extension.js
138+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/ipycanvas/index.js
139+
test -d $CONDA_PREFIX/share/jupyter/labextensions/ipycanvas
140+
test -f $CONDA_PREFIX/share/jupyter/labextensions/ipycanvas/package.json
141+
test -d $CONDA_PREFIX/share/jupyter/labextensions/ipycanvas/static
142+
143+
- name: Validate the nbextension
144+
run: jupyter nbextension list 2>&1 | grep "ipycanvas/extension"
145+
146+
- name: Validate the labextension
147+
run: jupyter labextension list 2>&1 | grep ipycanvas

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__/
77
*.so
88

99
# Distribution / packaging
10+
MANIFEST
1011
.Python
1112
env/
1213
build/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ conda install -c conda-forge ipycanvas
4040
And if you use jupyterlab <= 2:
4141

4242
```bash
43-
conda install -c conda-forge nodejs
43+
conda install -c conda-forge yarn
4444
jupyter labextension install @jupyter-widgets/jupyterlab-manager ipycanvas
4545
```
4646

dev-environment.yml

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

0 commit comments

Comments
 (0)