From 1f2502ed8548fa7e42cadde25895bc90cd99d072 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:00:46 +0200 Subject: [PATCH 01/17] ci: update micromamba action to use @main and new configuration --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dcd665ad..8a32136f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,12 +26,11 @@ jobs: - uses: actions/checkout@v2 - name: Setup conda - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@main with: environment-file: environment-dev.yml - condarc: | - dependencies: - - python==${{ matrix.python-version }} + init-shell: bash + cache-environment: true - name: Install ipyleaflet run: pip install python/jupyter_leaflet python/ipyleaflet --no-deps From 6ff5e22e47f128d382bb494a95efd654ad3977f6 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:15:27 +0200 Subject: [PATCH 02/17] ci: update Python version to 3.11 --- .github/workflows/main.yml | 2 +- environment-dev.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a32136f..336bcc15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.8] + python-version: [3.11] steps: - uses: actions/checkout@v2 diff --git a/environment-dev.yml b/environment-dev.yml index ffdd82f8..bc1bf1a3 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -2,6 +2,7 @@ name: ipyleaflet-dev channels: - conda-forge dependencies: + - python=3.11 - pip - build - wheel From 4dad96d3b78b6f8b2cb44af3a6e8400a176c1510 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:18:52 +0200 Subject: [PATCH 03/17] ci: use create-args for Python version instead of environment file --- .github/workflows/main.yml | 1 + environment-dev.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 336bcc15..af62c875 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ jobs: environment-file: environment-dev.yml init-shell: bash cache-environment: true + create-args: python=${{ matrix.python-version }} - name: Install ipyleaflet run: pip install python/jupyter_leaflet python/ipyleaflet --no-deps diff --git a/environment-dev.yml b/environment-dev.yml index bc1bf1a3..ffdd82f8 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -2,7 +2,6 @@ name: ipyleaflet-dev channels: - conda-forge dependencies: - - python=3.11 - pip - build - wheel From f679867b74e9903c6e59d12f50aa892604629722 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:20:40 +0200 Subject: [PATCH 04/17] ci: install build from pip instead of conda --- environment-dev.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment-dev.yml b/environment-dev.yml index ffdd82f8..c1ffcbc5 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -3,7 +3,6 @@ channels: - conda-forge dependencies: - pip - - build - wheel - jupyterlab~=4.0 - jupyter-packaging~=0.12 @@ -14,3 +13,5 @@ dependencies: - pandas - yarn~=3.0 - ruff + - pip: + - build From 52e8817c99acba6793a2a11f3afa140721b5ed85 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:25:22 +0200 Subject: [PATCH 05/17] ci: update actions/upload-artifact from v2 to v4 --- .github/workflows/ui-tests.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 10a615f5..914987d2 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -37,9 +37,25 @@ jobs: run: npx playwright test working-directory: ui-tests + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: test-results + retention-days: 5 + + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v4 + with: + name: screenshots + path: screenshots + retention-days: 5 + - name: Upload Playwright Test assets if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ipyleaflet-test-assets path: | @@ -47,7 +63,7 @@ jobs: - name: Upload Playwright Test report if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ipyleaflet-test-report path: | From f04f72ea48d7496f60c46baf89b737722ce92e6f Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:27:13 +0200 Subject: [PATCH 06/17] ci: exclude examples from ruff checks and ignore F403 for notebooks --- python/ipyleaflet/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ipyleaflet/pyproject.toml b/python/ipyleaflet/pyproject.toml index 43e2519d..e8a06679 100644 --- a/python/ipyleaflet/pyproject.toml +++ b/python/ipyleaflet/pyproject.toml @@ -58,10 +58,11 @@ packages = ["ipyleaflet"] [tool.ruff] extend-include = ["*.ipynb"] +exclude = ["examples"] [tool.ruff.lint] select = [ # pycodestyle "E", ] -ignore = ["E501", "E731"] +ignore = ["E501", "E731", "F403"] From ea604ff5cd5904a49adfd464578cf7de9272428c Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:31:08 +0200 Subject: [PATCH 07/17] ci: add sphinx.configuration to pyproject.toml --- python/ipyleaflet/pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/ipyleaflet/pyproject.toml b/python/ipyleaflet/pyproject.toml index e8a06679..9b7dffcb 100644 --- a/python/ipyleaflet/pyproject.toml +++ b/python/ipyleaflet/pyproject.toml @@ -56,6 +56,10 @@ exclude = [ [tool.hatch.build.targets.wheel] packages = ["ipyleaflet"] +[tool.sphinx.configuration] +source-dir = "docs" +build-dir = "docs/_build" + [tool.ruff] extend-include = ["*.ipynb"] exclude = ["examples"] From 34b6bc08682034ba158fd026388ccfc952d9dfe0 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:32:07 +0200 Subject: [PATCH 08/17] ci: fix sphinx.configuration to only include source directory --- python/ipyleaflet/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/python/ipyleaflet/pyproject.toml b/python/ipyleaflet/pyproject.toml index 9b7dffcb..2066c77f 100644 --- a/python/ipyleaflet/pyproject.toml +++ b/python/ipyleaflet/pyproject.toml @@ -58,7 +58,6 @@ packages = ["ipyleaflet"] [tool.sphinx.configuration] source-dir = "docs" -build-dir = "docs/_build" [tool.ruff] extend-include = ["*.ipynb"] From 0228853d3d04350a9c6dd8081987dfac49a55392 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:34:21 +0200 Subject: [PATCH 09/17] ci: configure ruff via command line options in workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af62c875..a29ca209 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-leaflet/package.json - name: Python Linters - run: ruff check --output-format=github . + run: ruff check --output-format=github --extend-include "*.ipynb" --exclude "examples" --ignore "E501,E731,F403" . - name: JS Linters run: | From 54fbc3075a2c699592b2136d0737881d4f8c50db Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:37:56 +0200 Subject: [PATCH 10/17] ci: add Sphinx configuration to .readthedocs.yaml --- .readthedocs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9285f5d4..ca9a52ae 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,3 +7,7 @@ build: conda: environment: docs/build-environment.yml + +sphinx: + configuration: docs/conf.py + fail_on_warning: true From 1c3147206e441c9e38fe76606e351a4850ec4f4c Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:46:03 +0200 Subject: [PATCH 11/17] ci: fix docs build environment dependencies --- docs/build-environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/build-environment.yml b/docs/build-environment.yml index 643137f8..1041544d 100644 --- a/docs/build-environment.yml +++ b/docs/build-environment.yml @@ -4,11 +4,11 @@ channels: - conda-forge dependencies: + - pip - yarn~=3.0 - jupyterlab~=4.0 - jupyter-packaging~=0.12 - jupyter-sphinx - - build - scipy - netcdf4 - geopandas @@ -19,5 +19,6 @@ dependencies: - jupyterlite-sphinx - jupyterlite-xeus-python >=0.9.2,<0.10 - pip: + - build - ../python/jupyter_leaflet - ../python/ipyleaflet From b18f696bd2a6624a5de50d80d09290b6f5b1b706 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:47:00 +0200 Subject: [PATCH 12/17] ci: remove invalid --extend-include argument from ruff command --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a29ca209..4474003d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-leaflet/package.json - name: Python Linters - run: ruff check --output-format=github --extend-include "*.ipynb" --exclude "examples" --ignore "E501,E731,F403" . + run: ruff check --output-format=github --exclude "examples" --ignore "E501,E731,F403" . - name: JS Linters run: | @@ -55,3 +55,8 @@ jobs: - name: Import check run: python -c 'import ipyleaflet' + + - name: Build documentation + run: | + pip install sphinx + sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html From 9204519effe02d0d3331ebb724a136877f13e5fe Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 14:49:57 +0200 Subject: [PATCH 13/17] ci: exclude ui-tests directory from ruff checks --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4474003d..04d581db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-leaflet/package.json - name: Python Linters - run: ruff check --output-format=github --exclude "examples" --ignore "E501,E731,F403" . + run: ruff check --output-format=github --exclude "examples,ui-tests" --ignore "E501,E731,F403" . - name: JS Linters run: | From 6f5a390f2008af28ddbc19be9abbb4a363c88386 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 15:13:47 +0200 Subject: [PATCH 14/17] refactor: replace geopandas.read_file with geodatasets.read_file in notebooks --- examples/CanvasRenderer.ipynb | 3 ++- examples/GPX.ipynb | 3 ++- examples/GeoData.ipynb | 7 ++++--- examples/GeoData_on_hover.ipynb | 7 ++++--- examples/KML.ipynb | 3 ++- examples/MarkerCluster-GeoJson.ipynb | 5 +++-- examples/MarkerCluster.ipynb | 5 +++-- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/examples/CanvasRenderer.ipynb b/examples/CanvasRenderer.ipynb index a2aecacd..ccfe35d1 100644 --- a/examples/CanvasRenderer.ipynb +++ b/examples/CanvasRenderer.ipynb @@ -8,7 +8,8 @@ "outputs": [], "source": [ "from ipyleaflet import Map, GeoData\n", - "import geopandas\n", + "import geopandas +import geodatasets\n", "import numpy as np\n", "import shapely" ] diff --git a/examples/GPX.ipynb b/examples/GPX.ipynb index c852a290..991ca888 100644 --- a/examples/GPX.ipynb +++ b/examples/GPX.ipynb @@ -16,7 +16,8 @@ "outputs": [], "source": [ "from ipyleaflet import Map, GeoData\n", - "import geopandas as gpd\n", + "import geopandas +import geodatasets as gpd\n", "import fiona" ] }, diff --git a/examples/GeoData.ipynb b/examples/GeoData.ipynb index 3bc162dd..b3fa9280 100644 --- a/examples/GeoData.ipynb +++ b/examples/GeoData.ipynb @@ -15,6 +15,7 @@ "source": [ "import ipyleaflet as ipy\n", "import geopandas\n", + "import geodatasets\n", "import json" ] }, @@ -33,9 +34,9 @@ "metadata": {}, "outputs": [], "source": [ - "countries = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n", - "cities = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_cities\"))\n", - "rivers = geopandas.read_file(\n", + "countries = geodatasets.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n", + "cities = geodatasets.read_file(geopandas.datasets.get_path(\"naturalearth_cities\"))\n", + "rivers = geodatasets.read_file(\n", " \"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_rivers_lake_centerlines.zip\"\n", ")" ] diff --git a/examples/GeoData_on_hover.ipynb b/examples/GeoData_on_hover.ipynb index 5a9b2481..2e240e0b 100644 --- a/examples/GeoData_on_hover.ipynb +++ b/examples/GeoData_on_hover.ipynb @@ -7,11 +7,12 @@ "outputs": [], "source": [ "from ipyleaflet import Map, GeoData, basemaps, LayersControl\n", - "import geopandas\n", + "import geopandas +import geodatasets\n", "import json\n", "\n", - "countries = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n", - "rivers = geopandas.read_file(\n", + "countries = geodatasets.read_file(geodatasets.get_path(\"naturalearth_lowres\"))\n", + "rivers = geodatasets.read_file(\n", " \"https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_rivers_lake_centerlines.zip\"\n", ")\n", "\n", diff --git a/examples/KML.ipynb b/examples/KML.ipynb index 63764b5c..1d7b9d14 100644 --- a/examples/KML.ipynb +++ b/examples/KML.ipynb @@ -16,7 +16,8 @@ "outputs": [], "source": [ "from ipyleaflet import Map, GeoData\n", - "import geopandas as gpd" + "import geopandas +import geodatasets as gpd" ] }, { diff --git a/examples/MarkerCluster-GeoJson.ipynb b/examples/MarkerCluster-GeoJson.ipynb index 972ccbdc..8fd1fe16 100644 --- a/examples/MarkerCluster-GeoJson.ipynb +++ b/examples/MarkerCluster-GeoJson.ipynb @@ -7,7 +7,8 @@ "outputs": [], "source": [ "from ipyleaflet import Map, Marker, MarkerCluster, GeoJSON, GeoData\n", - "import geopandas" + "import geopandas +import geodatasets" ] }, { @@ -16,7 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "cities = geopandas.read_file(\"zip://./geopandas_cities.zip\")" + "cities = geodatasets.read_file(\"zip://./geopandas_cities.zip\")" ] }, { diff --git a/examples/MarkerCluster.ipynb b/examples/MarkerCluster.ipynb index cdc10be3..5f5dab1c 100644 --- a/examples/MarkerCluster.ipynb +++ b/examples/MarkerCluster.ipynb @@ -7,10 +7,11 @@ "outputs": [], "source": [ "from ipyleaflet import Map, Marker, MarkerCluster\n", - "import geopandas\n", + "import geopandas +import geodatasets\n", "\n", "\n", - "cities = geopandas.read_file(\"zip://./geopandas_cities.zip\")\n", + "cities = geodatasets.read_file(\"zip://./geopandas_cities.zip\")\n", "\n", "m = Map(center=(42.5, -41.6), zoom=2)\n", "m.add(\n", From d5e9c7113a57acd5d0a2f6498e4f355bf743992a Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 15:21:55 +0200 Subject: [PATCH 15/17] fix: update build environment to include jupyter_sphinx --- .github/workflows/main.yml | 2 +- docs/build-environment.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04d581db..1bf3ebf8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,5 +58,5 @@ jobs: - name: Build documentation run: | - pip install sphinx + pip install sphinx jupyter_sphinx jupyterlite_sphinx pydata_sphinx_theme sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html diff --git a/docs/build-environment.yml b/docs/build-environment.yml index 1041544d..b8a02a3b 100644 --- a/docs/build-environment.yml +++ b/docs/build-environment.yml @@ -18,6 +18,7 @@ dependencies: - pydata-sphinx-theme - jupyterlite-sphinx - jupyterlite-xeus-python >=0.9.2,<0.10 + - geodatasets - pip: - build - ../python/jupyter_leaflet From 13a086eea73c4aef78a5c569174feb4f0be15a5f Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 15:32:22 +0200 Subject: [PATCH 16/17] fix: update geopandas import in geodata.rst --- docs/layers/geodata.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/layers/geodata.rst b/docs/layers/geodata.rst index 746cd4f1..bf271a95 100644 --- a/docs/layers/geodata.rst +++ b/docs/layers/geodata.rst @@ -12,9 +12,10 @@ Examples from ipyleaflet import Map, GeoData, basemaps, LayersControl import geopandas + import geodatasets import json - countries = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres')) + countries = geodatasets.read_file(geodatasets.get_path('naturalearth_lowres')) m = Map(center=(52.3,8.0), zoom = 3, basemap= basemaps.Esri.WorldTopoMap) From 2667e2f9b416602925b38c38f0538b22e5ffbfba Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 29 Apr 2025 15:33:15 +0200 Subject: [PATCH 17/17] chore: remove docs building from CI as it's handled by readthedocs --- .github/workflows/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bf3ebf8..a7456c9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,8 +55,3 @@ jobs: - name: Import check run: python -c 'import ipyleaflet' - - - name: Build documentation - run: | - pip install sphinx jupyter_sphinx jupyterlite_sphinx pydata_sphinx_theme - sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html