Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipywidgets 8.0 support #968

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
channels: conda-forge

- name: Mamba install dependencies
run: mamba install python=${{ matrix.python-version }} pip nodejs=16 flake8 jupyterlab ipywidgets jupyter-packaging~=0.7.9
run: mamba install python=${{ matrix.python-version }} pip nodejs=16 flake8 jupyterlab ipywidgets>=8.0.1 jupyter-packaging~=0.7.9

- name: Install ipyleaflet
run: pip install .
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ docs/test.wkt
*Untitled*.ipynb

#Galata
ui-test/playwright-report
ui-test/test-results
ui-tests/playwright-report
ui-tests/test-results
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter-widgets/base": "^2 || ^3 || ^4.0.0",
"@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"leaflet": "^1.7.1",
Expand Down
1 change: 0 additions & 1 deletion js/src/controls/LayersControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class LeafletLayersControlView extends control.LeafletControlView {
*/

initialize(parameters) {
super.initialize(parameters);
super.initialize(parameters);
this.map_view = this.options.map_view;
}
Expand Down
4,583 changes: 3,108 additions & 1,475 deletions js/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0,==3.*", "setuptools>=40.8.0", "wheel"]
requires = ["jupyter_packaging~=0.12", "jupyterlab>=3.0.0,==3.*", "setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[bdist_wheel]
universal=1

[metadata]
license_file = LICENSE
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
description='A Jupyter widget for dynamic Leaflet maps',
long_description=long_description,
license='MIT License',
python_requires = ">=3.7",
include_package_data=True,
install_requires=[
'ipywidgets>=7.6.0,<8',
'ipywidgets>=7.6.0,<9',
'traittypes>=0.2.1,<3',
'xyzservices>=2021.8.1',
'branca>=0.5.0'
Expand All @@ -73,7 +74,6 @@
'Topic :: Multimedia :: Graphics',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/notebooks/MagnifyingGlass.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"center = [48.265643898808236, 336.7529296875]\n",
"\n",
"m = Map(center=center, zoom=7)\n",
"m = Map(center=center, zoom=2)\n",
"\n",
"topo_layer = basemap_to_tiles(basemaps.OpenTopoMap)\n",
"magnifying_glass = MagnifyingGlass(layers=[topo_layer])\n",
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/notebooks/TileLayer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"center = [48.265643898808236, 336.7529296875]\n",
"\n",
"m = Map(center=center, zoom=7)\n",
"m = Map(center=center, zoom=2)\n",
"\n",
"dark_matter_layer = basemap_to_tiles(basemaps.CartoDB.DarkMatter)\n",
"m.add(dark_matter_layer)\n",
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"author": "ipyleaflet",
"license": "MIT",
"dependencies": {
"@jupyterlab/galata": "^4.0.2",
"@jupyterlab/galata": "^4.3.5",
"rimraf": "^3.0.2"
}
}
7 changes: 6 additions & 1 deletion ui-tests/tests/ipyleaflet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ async function renderMap(fileName: string, page: IJupyterLabPageFixture) {
await page.notebook.waitForRun();
const maps = await page.$("div.leaflet-container");
await new Promise((_) => setTimeout(_, 1000));
expect(await maps.screenshot()).toMatchSnapshot({

// Move the mouse to the center of the map
const bb = await maps?.boundingBox();
await page.mouse.move(bb!.x + bb!.width / 2, bb!.y + bb!.height / 2);

expect(await maps!.screenshot()).toMatchSnapshot({
name: `${fileName}.png`,
});
}
Expand Down
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/DivIcon-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/DrawControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/Icon-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/LayersControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/LegendControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/Marker-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/Polyline-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/Popup-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/ScaleControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/WidgetControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ipyleaflet.test.ts-snapshots/ZoomControl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading