From 75ec4b1c3f7425dafdb4346063533a88cb8fa0a9 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Mon, 16 Jun 2025 22:38:02 +0200 Subject: [PATCH 01/19] Fix pattern error --- .github/workflows/save_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/save_coverage.yml b/.github/workflows/save_coverage.yml index 11b3afc605..071f8c9d0c 100644 --- a/.github/workflows/save_coverage.yml +++ b/.github/workflows/save_coverage.yml @@ -15,7 +15,7 @@ jobs: uses: actions/download-artifact@v4 with: path: combined-coverage - pattern: coverage-* + pattern: coverage* merge-multiple: true token: ${{ secrets.GITHUB_TOKEN }} From c7d8df3df889d19a4cfb979750d17ab7ab568391 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Sat, 28 Jun 2025 21:51:48 +0200 Subject: [PATCH 02/19] Close issue_2165 Add event handlers on the cut event --- folium/plugins/geoman.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/folium/plugins/geoman.py b/folium/plugins/geoman.py index dc4c05be4c..a427961191 100644 --- a/folium/plugins/geoman.py +++ b/folium/plugins/geoman.py @@ -64,6 +64,18 @@ class GeoMan(JSCSSMixin, MacroElement): {%- endfor %} }); + {{ this._parent.get_name() }}.on("pm:cut", function(e) { + var layer = e.layer, + type = e.layerType; + + {%- for event, handler in this.on.items() %} + layer.on( + "{{event}}", + {{handler}} + ); + {%- endfor %} + }); + {% endmacro %} """ ) From 475a191f6705286fe877401dbbeb12b55dc6ddc5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:29:04 +0200 Subject: [PATCH 03/19] docs: Update switcher.json for v0.20.0 (#2164) Co-authored-by: hansthen <2202342+hansthen@users.noreply.github.com> --- docs/_static/switcher.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_static/switcher.json b/docs/_static/switcher.json index 601d81a7a8..dd94201e11 100644 --- a/docs/_static/switcher.json +++ b/docs/_static/switcher.json @@ -4,10 +4,14 @@ "url": "https://python-visualization.github.io/folium/dev/" }, { - "name": "latest (0.19.7)", - "version": "0.19.7", + "name": "latest (0.20.0)", + "version": "0.20.0", "url": "https://python-visualization.github.io/folium/latest/" }, + { + "version": "0.19.7", + "url": "https://python-visualization.github.io/folium/v0.19.7/" + }, { "version": "0.19.6", "url": "https://python-visualization.github.io/folium/v0.19.6/" From b63de61c03f103e2081642a74f7468d5cac05cdd Mon Sep 17 00:00:00 2001 From: Hans Then Date: Mon, 16 Jun 2025 22:45:23 +0200 Subject: [PATCH 04/19] Run coverage in bash --- .github/workflows/test_code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index ab966c9e29..b4e7c69fc2 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -41,6 +41,7 @@ jobs: pip install pixelmatch - name: Code tests + shell: bash -l {0} run: coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots - name: Upload coverage From 3e5e621142368e53d677f7126e81c415ebf745c3 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Mon, 16 Jun 2025 22:49:17 +0200 Subject: [PATCH 05/19] Show what files are generated --- .github/workflows/test_code.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index b4e7c69fc2..342abcfeda 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -42,7 +42,9 @@ jobs: - name: Code tests shell: bash -l {0} - run: coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots + run: | + coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots + ls -la - name: Upload coverage if: always() From 9df7cd387236b33ca64281f6c0fcf09925926152 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Mon, 16 Jun 2025 22:54:11 +0200 Subject: [PATCH 06/19] Try again --- .github/workflows/test_code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 342abcfeda..0dd497f298 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -44,6 +44,7 @@ jobs: shell: bash -l {0} run: | coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots + pwd ls -la - name: Upload coverage From 053991a2d388db074b12402600f8870d6a30efca Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:21:23 +0200 Subject: [PATCH 07/19] Try absolute path --- .github/workflows/test_code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 0dd497f298..85504e82c5 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -53,4 +53,4 @@ jobs: with: name: coverage-test-code path: | - .coverage* + /home/runner/work/folium/folium/.coverage* From 589dffb7d6a580fa76abc658d090cf3e895bbddb Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:27:47 +0200 Subject: [PATCH 08/19] Try again --- .github/workflows/test_code.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 85504e82c5..bb4e15287e 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -36,21 +36,25 @@ jobs: run: python -m pip install -e . --no-deps --force-reinstall - name: Install pixelmatch - shell: bash -l {0} run: | pip install pixelmatch - name: Code tests - shell: bash -l {0} run: | coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots pwd ls -la + - name: Debug step + run: | + echo '=====' + pwd + ls .coverage* + - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: name: coverage-test-code path: | - /home/runner/work/folium/folium/.coverage* + .coverage* From 7a6fc8fce4a3a210c5579456cf39d07aa0852583 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:35:03 +0200 Subject: [PATCH 09/19] Different pattern --- .github/workflows/test_code.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index bb4e15287e..01034c937f 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -56,5 +56,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage-test-code - path: | - .coverage* + path: .coverage.*.*.* From 59f63ed8960add1bcad50b264fb4819164d373de Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:42:22 +0200 Subject: [PATCH 10/19] Remove failing workflow --- .github/workflows/save_coverage.yml | 36 ----------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/save_coverage.yml diff --git a/.github/workflows/save_coverage.yml b/.github/workflows/save_coverage.yml deleted file mode 100644 index 071f8c9d0c..0000000000 --- a/.github/workflows/save_coverage.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Upload coverage - -on: - workflow_run: - workflows: ['Code Tests', 'Geopandas tests', 'Code Tests with Latest branca', 'Selenium Tests', 'Run Snapshot Tests', 'Run Streamlit Folium Tests'] - types: [completed] - -jobs: - run: - runs-on: ubuntu-latest - - steps: - - name: Download coverage files from previous steps - id: download-artifacts - uses: actions/download-artifact@v4 - with: - path: combined-coverage - pattern: coverage* - merge-multiple: true - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install coverage - run: pip install coverage - - - name: Combine coverage - run: coverage combine - - - name: Generate report - run: coverage html --skip-covered - - - name: Upload coverage report - if: always() - uses: actions/upload-artifact@v4 - with: - name: combined-coverage - path: htmlcov/** From a23807b91d6ef07ef7aba29265d64a9accae8848 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:52:21 +0200 Subject: [PATCH 11/19] Try renaming before upload --- .github/workflows/test_code.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 01034c937f..7287c3d13a 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -50,10 +50,11 @@ jobs: echo '=====' pwd ls .coverage* + cp .coverage.* /tmp/coverage - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: name: coverage-test-code - path: .coverage.*.*.* + path: /tmp/coverage From d3adcdbec564fcd6fd7dc3ea2dc6d61e3695afff Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 07:55:22 +0200 Subject: [PATCH 12/19] Try wildcards --- .github/workflows/test_code.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 7287c3d13a..bd77b3e309 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -50,11 +50,11 @@ jobs: echo '=====' pwd ls .coverage* - cp .coverage.* /tmp/coverage + cp .coverage.* /tmp/ - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: name: coverage-test-code - path: /tmp/coverage + path: /tmp/.coverage.* From 5a6a25f3a0e61c84a4fae2b596642d69a235fcae Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 21:00:06 +0200 Subject: [PATCH 13/19] Use matrix name in coverage artifact --- .github/workflows/test_code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index bd77b3e309..6de3c60acc 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -56,5 +56,5 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: coverage-test-code + name: coverage-test-code-${{ matrix.os }}-${{ matrix.python_version }} path: /tmp/.coverage.* From 813ed251eef7ad48d7065987a033bdbd83a023bf Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 21:05:36 +0200 Subject: [PATCH 14/19] One more try before I give up --- .github/workflows/test_code.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 6de3c60acc..65475bf7f7 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -47,14 +47,13 @@ jobs: - name: Debug step run: | - echo '=====' pwd + echo '=====' ls .coverage* - cp .coverage.* /tmp/ - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: name: coverage-test-code-${{ matrix.os }}-${{ matrix.python_version }} - path: /tmp/.coverage.* + path: .coverage* From 1f531ee43406da64b6c11011a5386bcdef749c37 Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 21:08:46 +0200 Subject: [PATCH 15/19] Was unable to find variable --- .github/workflows/test_code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 65475bf7f7..31d0861487 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -55,5 +55,5 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: coverage-test-code-${{ matrix.os }}-${{ matrix.python_version }} + name: coverage-test-code-${{ matrix.os }}-${{ matrix.python-version }} path: .coverage* From c7424316fd179cbad91d2703779d13ae8db350ea Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 21:12:10 +0200 Subject: [PATCH 16/19] Also upload hidden files --- .github/workflows/test_code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index 31d0861487..a59bcfc7d5 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -57,3 +57,4 @@ jobs: with: name: coverage-test-code-${{ matrix.os }}-${{ matrix.python-version }} path: .coverage* + include-hidden-files: true From 5f0b8aacaf7ed94a7cc25f1cdd2d25415ea20c2a Mon Sep 17 00:00:00 2001 From: Hans Then Date: Tue, 17 Jun 2025 21:26:05 +0200 Subject: [PATCH 17/19] Cleanup --- .github/workflows/test_code.yml | 6 ------ .github/workflows/test_geopandas.yml | 4 ++++ .github/workflows/test_latest_branca.yml | 6 ++++-- .github/workflows/test_mypy.yml | 5 +++-- .github/workflows/test_selenium.yml | 8 +++++--- .github/workflows/test_snapshots.yml | 7 ++++--- .github/workflows/test_streamlit_folium.yml | 9 +++------ 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index a59bcfc7d5..6026d8bb9c 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -45,12 +45,6 @@ jobs: pwd ls -la - - name: Debug step - run: | - pwd - echo '=====' - ls .coverage* - - name: Upload coverage if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/test_geopandas.yml b/.github/workflows/test_geopandas.yml index 219b3db194..d921235cbd 100644 --- a/.github/workflows/test_geopandas.yml +++ b/.github/workflows/test_geopandas.yml @@ -11,6 +11,9 @@ on: jobs: run: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - name: Checkout Folium @@ -55,3 +58,4 @@ jobs: name: coverage-test-geopandas path: | .coverage* + include-hidden-files: true diff --git a/.github/workflows/test_latest_branca.yml b/.github/workflows/test_latest_branca.yml index 0f0f4ea70e..43be4369df 100644 --- a/.github/workflows/test_latest_branca.yml +++ b/.github/workflows/test_latest_branca.yml @@ -11,6 +11,9 @@ on: jobs: run: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v4 @@ -25,11 +28,9 @@ jobs: --file requirements-dev.txt - name: Install folium from source - shell: bash -l {0} run: python -m pip install -e . --no-deps --force-reinstall - name: Tests with latest branca - shell: bash -l {0} run: | micromamba remove branca --yes --force python -m pip install git+https://github.com/python-visualization/branca.git @@ -42,3 +43,4 @@ jobs: name: coverage-test-branca path: | .coverage* + include-hidden-files: true diff --git a/.github/workflows/test_mypy.yml b/.github/workflows/test_mypy.yml index d2504e0fcc..8b1ad260c6 100644 --- a/.github/workflows/test_mypy.yml +++ b/.github/workflows/test_mypy.yml @@ -11,6 +11,9 @@ on: jobs: run: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v4 @@ -25,11 +28,9 @@ jobs: --file requirements-dev.txt - name: Install folium from source - shell: bash -l {0} run: | python -m pip install -e . --no-deps --force-reinstall - name: Mypy test - shell: bash -l {0} run: | mypy folium diff --git a/.github/workflows/test_selenium.yml b/.github/workflows/test_selenium.yml index e1d876d33c..b8a3225760 100644 --- a/.github/workflows/test_selenium.yml +++ b/.github/workflows/test_selenium.yml @@ -15,6 +15,9 @@ jobs: matrix: python-version: [ "3.9", "3.13" ] fail-fast: false + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v4 @@ -29,17 +32,16 @@ jobs: --file requirements-dev.txt - name: Install folium from source - shell: bash -l {0} run: python -m pip install -e . --no-deps --force-reinstall - name: Selenium tests - shell: bash -l {0} run: coverage run -p -m pytest tests/selenium -vv - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: - name: coverage-test-selenium + name: coverage-test-selenium-${{ matrix.python-version }} path: | .coverage* + include-hidden-files: true diff --git a/.github/workflows/test_snapshots.yml b/.github/workflows/test_snapshots.yml index 14cac92028..8a21c7cc57 100644 --- a/.github/workflows/test_snapshots.yml +++ b/.github/workflows/test_snapshots.yml @@ -9,6 +9,9 @@ on: jobs: run: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - name: Checkout Folium @@ -24,17 +27,14 @@ jobs: --file requirements-dev.txt - name: Install pytest plugins and pixelmatch - shell: bash -l {0} run: | pip install pixelmatch pytest-github-actions-annotate-failures pytest-rerunfailures - name: Install folium from source - shell: bash -l {0} run: | python -m pip install -e . --no-deps --force-reinstall - name: Test with pytest - shell: bash -l {0} run: | coverage run -p -m pytest tests/snapshots -s --junit-xml=test-results.xml @@ -61,3 +61,4 @@ jobs: name: coverage-test-snapshots path: | .coverage* + include-hidden-files: true diff --git a/.github/workflows/test_streamlit_folium.yml b/.github/workflows/test_streamlit_folium.yml index bf7821743d..10ebeb486f 100644 --- a/.github/workflows/test_streamlit_folium.yml +++ b/.github/workflows/test_streamlit_folium.yml @@ -11,6 +11,9 @@ on: jobs: run: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - name: Set up Python @@ -29,27 +32,23 @@ jobs: path: streamlit_folium # Checkout into a subdirectory - name: Build streamlit_folium javascript - shell: bash -l {0} run: | cd streamlit_folium/streamlit_folium/frontend/ npm install npm run build - name: Install streamlit_folium dev dependencies - shell: bash -l {0} run: | cd streamlit_folium python -m pip install --upgrade pip pip install -r tests/requirements.txt - name: Install streamlit-folium - shell: bash -l {0} run: | cd streamlit_folium pip install -e . - name: Install playwright dependencies - shell: bash -l {0} run: | playwright install --with-deps @@ -57,12 +56,10 @@ jobs: run: pip install pytest-github-actions-annotate-failures coverage - name: Install folium from source - shell: bash -l {0} run: | python -m pip install -e . --force-reinstall - name: Test with pytest and retry flaky tests up to 3 times - shell: bash -l {0} run: | cd streamlit_folium python -m pytest tests/test_frontend.py --browser chromium -s --reruns 3 -k "not test_layer_control_dynamic_update" From 2a64bdaa5cecc55bd4cc6080b765ccb391db4fa6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 16:25:10 +0000 Subject: [PATCH 18/19] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.12 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.12...v0.12.2) - [github.com/keewis/blackdoc: v0.3.9 → v0.4.1](https://github.com/keewis/blackdoc/compare/v0.3.9...v0.4.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27ce4ea7f5..83a0724de7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: files: requirements-dev.txt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.12 + rev: v0.12.2 hooks: - id: ruff @@ -28,7 +28,7 @@ repos: language_version: python3 - repo: https://github.com/keewis/blackdoc - rev: v0.3.9 + rev: v0.4.1 hooks: - id: blackdoc From 34082c2952bad17e46f24ad62ee40d3ffcfe7a0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 16:25:49 +0000 Subject: [PATCH 19/19] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/ISSUE_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 0c341f496d..854eb67263 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,7 +2,6 @@ ```python # Your code here - ``` #### Problem description