Skip to content

Commit af415fc

Browse files
ianhimartinRenou
authored andcommitted
update ipywidgets dependency
1 parent 8a3740d commit af415fc

File tree

53 files changed

+4522
-6377
lines changed

Some content is hidden

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

53 files changed

+4522
-6377
lines changed

.github/workflows/main.yml

+30-94
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,14 @@ on:
77
pull_request:
88
branches:
99
- main
10+
schedule:
11+
- cron: "0 12 * * 1" # monday at noon UTC
1012

1113
defaults:
1214
run:
1315
shell: bash -l {0}
1416

1517
jobs:
16-
run:
17-
runs-on: ${{ matrix.os }}
18-
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
os: [ubuntu-latest]
23-
python-version: [3.8]
24-
25-
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v2
28-
29-
- name: Setup conda
30-
uses: conda-incubator/setup-miniconda@v2
31-
with:
32-
activate-environment: ipympl-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
38-
39-
- name: Install ipympl
40-
run: |
41-
python -m build
42-
pip install dist/*.whl
43-
44-
- name: Check installation files
45-
run: |
46-
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
47-
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/extension.js
48-
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/index.js
49-
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
50-
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
51-
52-
- name: Check nbextension and labextension
53-
run: |
54-
jupyter nbextension list 2>&1 | grep -ie "jupyter-matplotlib/extension.*enabled" -
55-
jupyter labextension list 2>&1 | grep -ie "jupyter-matplotlib.*enabled.*ok" -
56-
57-
- name: Run tests
58-
run: pytest .
59-
6018
build:
6119
runs-on: ubuntu-latest
6220
steps:
@@ -86,25 +44,23 @@ jobs:
8644
name: dist ${{ github.run_number }}
8745
path: ./dist
8846

89-
install:
47+
Test:
9048
runs-on: ${{ matrix.os }}-latest
9149
needs: [build]
9250

9351
strategy:
9452
fail-fast: false
9553
matrix:
9654
os: [ubuntu, macos]
97-
python: ['3.6', '3.9']
55+
python: ['3.10', '3.9']
56+
mpl-version: ['3.5', 'latest']
9857
include:
99-
- python: '3.6'
58+
- python: '3.10'
10059
dist: 'ipympl*.tar.gz'
101-
jlab_version: 3
10260
- python: '3.9'
10361
dist: 'ipympl*.whl'
104-
jlab_version: 2.3.2
10562

10663
steps:
107-
10864
- name: Checkout
10965
uses: actions/checkout@v2
11066

@@ -117,7 +73,15 @@ jobs:
11773
channels: conda-forge
11874

11975
- name: Install dependencies
120-
run: mamba install python=${{ matrix.python-version }} pip yarn jupyterlab=${{ matrix.jlab_version }} ipywidgets jupyter-packaging
76+
run: mamba install python=${{ matrix.python-version }} pip yarn nodejs=16 jupyterlab jupyter-packaging nbval pytest ipywidgets
77+
78+
- if: matrix.mpl-version == 'latest'
79+
name: Install latest Matplotlib
80+
run: pip install --upgrade --pre --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple --extra-index-url https://pypi.org/simple matplotlib
81+
82+
- if: matrix.mpl-version != 'latest'
83+
name: Install matplotlib pinned
84+
run: mamba install matplotlib=${{ matrix.mpl-version}}.*
12185

12286
- uses: actions/download-artifact@v2
12387
with:
@@ -129,12 +93,6 @@ jobs:
12993
cd dist
13094
pip install -vv ${{ matrix.dist }}
13195
132-
- name: Manually install labextension for lab2
133-
if: ${{ matrix.jlab_version }} == 2.3.2
134-
env:
135-
NODE_OPTIONS: --openssl-legacy-provider
136-
run: jupyter labextension install --debug .
137-
13896
- name: Test installation files
13997
run: |
14098
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
@@ -150,60 +108,38 @@ jobs:
150108
- name: Validate the labextension
151109
run: jupyter labextension list 2>&1 | grep jupyter-matplotlib
152110

111+
- name: Run pytest
112+
run: pytest .
153113

154-
visual-regression-tests:
155-
runs-on: ubuntu-latest
156-
needs: [build]
157-
158-
strategy:
159-
fail-fast: false
160-
161-
steps:
162-
163-
- name: Checkout
164-
uses: actions/checkout@v2
165-
166-
- name: Setup conda
167-
uses: conda-incubator/setup-miniconda@v2
168-
with:
169-
python-version: 3.9
170-
mamba-version: "*"
171-
auto-activate-base: false
172-
channels: conda-forge
173-
174-
- name: Install dependencies
175-
run: mamba install pip yarn jupyterlab=3.0.11 ipywidgets jupyter-packaging
176-
177-
- uses: actions/download-artifact@v2
178-
with:
179-
name: dist ${{ github.run_number }}
180-
path: ./dist
181-
182-
- name: Install the package
183-
run: pip install -vv ipympl*.whl
184-
working-directory: dist
185-
186-
- name: Install test dependencies
187-
run: yarn install
114+
- name: Install Galata test dependencies
115+
if: matrix.os == 'ubuntu'
116+
run: |
117+
yarn install
118+
yarn playwright install chromium
188119
working-directory: ui-tests
189120

190121
- name: Launch JupyterLab
191-
run: yarn run start-jlab:detached
122+
if: matrix.os == 'ubuntu'
123+
run: yarn run start:detached
192124
working-directory: ui-tests
193125

194126
- name: Wait for JupyterLab
127+
if: matrix.os == 'ubuntu'
195128
uses: ifaxity/wait-on-action@v1
196129
with:
197130
resource: http-get://localhost:8888/api
198131
timeout: 20000
199132

200133
- name: Run UI Tests
134+
if: matrix.os == 'ubuntu'
201135
run: yarn run test
202136
working-directory: ui-tests
203137

204138
- name: Upload UI Test artifacts
205-
if: always()
139+
if: always() && matrix.os == 'ubuntu'
206140
uses: actions/upload-artifact@v2
207141
with:
208142
name: ui-test-output
209-
path: ui-tests/test-output
143+
path: |
144+
ui-tests/playwright-report
145+
ui-tests/test-results

.github/workflows/mpl-latest.yml

-59
This file was deleted.

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ipympl/nbextension/index.*
2121
ipympl/nbextension/package.json
2222
ipympl/labextension/*.tgz
2323

24-
ui-tests/test-output
24+
ui-tests/test-results
25+
ui-tests/playwright-report
2526

2627
# Coverage data
2728
# -------------

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ipympl
22

3-
[![Test Status](https://github.com/matplotlib/ipympl/actions/workflows/mpl-latest.yml/badge.svg)](https://github.com/matplotlib/ipympl/actions/workflows/mpl-latest.yml?query=branch%3Amaster)
3+
[![Test Status](https://github.com/matplotlib/ipympl/actions/workflows/main.yml/badge.svg)](https://github.com/matplotlib/ipympl/actions/workflows/main.yml?query=branch%3Amain)
44
[![Latest PyPI version](https://img.shields.io/pypi/v/ipympl?logo=pypi)](https://pypi.python.org/pypi/ipympl)
55
[![Latest conda-forge version](https://img.shields.io/conda/vn/conda-forge/ipympl?logo=conda-forge)](https://anaconda.org/conda-forge/ipympl)
66
[![Latest npm version](https://img.shields.io/npm/v/jupyter-matplotlib?logo=npm)](https://www.npmjs.com/package/jupyter-matplotlib)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"webpack-cli": "^4.0.0"
8282
},
8383
"dependencies": {
84-
"@jupyter-widgets/base": "^2 || ^3 || ^4.0.0",
84+
"@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6",
8585
"@types/node": "^14.14.35",
8686
"lodash": "^4.17.21"
8787
},

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
'ipython_genutils',
6464
'pillow',
6565
'traitlets<6',
66-
'ipywidgets>=7.6.0,<8',
66+
'ipywidgets>=7.6.0,<9',
6767
'matplotlib>=3.4.0,<4',
6868
],
6969
extras_require={

ui-tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Finally, run the galata tests:
2020
yarn run test
2121
```
2222

23-
If bqplot visuals change, you can re-generate reference images by running:
23+
If ipympl visuals change, you can re-generate reference images by running:
2424
```bash
2525
yarn run update-references
2626
```

ui-tests/galata-config.json

-3
This file was deleted.

ui-tests/jupyter_server_config.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
from tempfile import mkdtemp
2+
13
c.ServerApp.port = 8888 # noqa
24
c.ServerApp.token = "" # noqa
35
c.ServerApp.password = "" # noqa
46
c.ServerApp.disable_check_xsrf = True # noqa
57
c.ServerApp.open_browser = False # noqa
6-
c.LabApp.open_browser = False # noqa
8+
c.ServerApp.root_dir = mkdtemp(prefix='galata-test-') # noqa
9+
710
c.LabApp.expose_app_in_browser = True # noqa

ui-tests/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
"description": "ipympl UI Tests",
55
"private": true,
66
"scripts": {
7-
"start-jlab": "jupyter lab --config ./jupyter_server_config.py",
8-
"start-jlab:detached": "yarn run start-jlab&",
9-
"clean": "rimraf tests/notebooks/.ipynb_checkpoints && rimraf test-output",
10-
"test": "yarn run clean && galata --image-match-threshold 0.33",
11-
"update-references": "galata --update-references"
7+
"start": "jupyter lab --config ./jupyter_server_config.py",
8+
"start:detached": "yarn run start&",
9+
"test": "playwright test",
10+
"test:debug": "PWDEBUG=1 playwright test",
11+
"test:report": "http-server ./playwright-report -a localhost -o",
12+
"test:update": "playwright test --update-snapshots"
1213
},
1314
"author": "ipympl",
1415
"license": "Apache-2.0",
1516
"dependencies": {
16-
"@jupyterlab/galata": "3.0.11-2",
17+
"@jupyterlab/galata": "^4.3.5",
1718
"klaw-sync": "^6.0.0",
1819
"rimraf": "^3.0.2"
1920
}

ui-tests/playwright.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');
2+
3+
module.exports = {
4+
...baseConfig,
5+
timeout: 600000,
6+
retries: 1,
7+
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)