Skip to content
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
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

```python
# Your code here

```
#### Problem description

Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/save_coverage.yml

This file was deleted.

12 changes: 7 additions & 5 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ 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
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
pwd
ls -la

- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-test-code
path: |
.coverage*
name: coverage-test-code-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage*
include-hidden-files: true
4 changes: 4 additions & 0 deletions .github/workflows/test_geopandas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout Folium
Expand Down Expand Up @@ -55,3 +58,4 @@ jobs:
name: coverage-test-geopandas
path: |
.coverage*
include-hidden-files: true
6 changes: 4 additions & 2 deletions .github/workflows/test_latest_branca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
Expand All @@ -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
Expand All @@ -42,3 +43,4 @@ jobs:
name: coverage-test-branca
path: |
.coverage*
include-hidden-files: true
5 changes: 3 additions & 2 deletions .github/workflows/test_mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
Expand All @@ -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
8 changes: 5 additions & 3 deletions .github/workflows/test_selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
7 changes: 4 additions & 3 deletions .github/workflows/test_snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout Folium
Expand All @@ -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

Expand All @@ -61,3 +61,4 @@ jobs:
name: coverage-test-snapshots
path: |
.coverage*
include-hidden-files: true
9 changes: 3 additions & 6 deletions .github/workflows/test_streamlit_folium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Set up Python
Expand All @@ -29,40 +32,34 @@ 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

- name: Install annotate-failures-plugin
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"
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
8 changes: 6 additions & 2 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
12 changes: 12 additions & 0 deletions folium/plugins/geoman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
"""
)
Expand Down
Loading