Skip to content

Commit 1ef23cf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pass-tilelayer-to-map
2 parents eb1e609 + c7cfd07 commit 1ef23cf

23 files changed

+97
-173
lines changed
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,45 @@
11
name: Publish to PyPI
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
10-
release:
11-
types:
12-
- published
3+
on: ["push", "pull_request"]
4+
5+
defaults:
6+
run:
7+
shell: bash
138

149
jobs:
1510
packages:
1611
runs-on: ubuntu-latest
1712
steps:
18-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1914

2015
- name: Set up Python
21-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v4
2217
with:
2318
python-version: 3.x
2419

2520
- name: Get tags
2621
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
27-
shell: bash
22+
2823

2924
- name: Install build tools
3025
run: |
3126
python -m pip install --upgrade pip wheel build twine
3227
33-
shell: bash
34-
3528
- name: Build binary wheel and sdist
3629
run: python -m build --sdist --wheel . --outdir dist
3730

3831
- name: CheckFiles
3932
run: |
4033
ls dist
41-
shell: bash
4234
4335
- name: Test wheels
4436
run: |
4537
cd dist && python -m pip install folium*.whl
4638
python -m twine check *
47-
shell: bash
4839
4940
- name: Publish a Python distribution to PyPI
50-
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
51-
uses: pypa/gh-action-pypi-publish@master
41+
if: ${{ github.event_name == 'release' }}
42+
uses: pypa/gh-action-pypi-publish@v1.5.1
5243
with:
5344
user: __token__
5445
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/release.yaml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/test_code.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Code Tests
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [main]
3+
on: [push, pull_request]
74

85
jobs:
96
run:
@@ -15,24 +12,22 @@ jobs:
1512
fail-fast: false
1613

1714
steps:
18-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1916

20-
- name: Setup Conda
21-
uses: s-weigand/setup-conda@v1
17+
- name: Setup Micromamba
18+
uses: mamba-org/provision-with-micromamba@v13
2219
with:
23-
activate-conda: false
24-
update-conda: true
25-
conda-channels: conda-forge
20+
environment-file: false
2621

2722
- name: Python ${{ matrix.python-version }}
2823
shell: bash -l {0}
2924
run: |
30-
conda create --yes --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt --strict-channel-priority
31-
source activate TEST
32-
pip install -e . --no-deps --force-reinstall
25+
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
26+
micromamba activate TEST
27+
python -m pip install -e . --no-deps --force-reinstall
3328
3429
- name: Tests
3530
shell: bash -l {0}
3631
run: |
37-
source activate TEST
38-
pytest -vv --ignore=tests/selenium
32+
micromamba activate TEST
33+
python -m pytest -vv --ignore=tests/selenium
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: Notebook Code Tests
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
on: [push, pull_request]
104

115
jobs:
126
run:
137
runs-on: ubuntu-latest
148

159
steps:
16-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1711

18-
- name: Setup Conda
19-
uses: s-weigand/setup-conda@v1
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v13
2014
with:
21-
activate-conda: false
22-
conda-channels: conda-forge
15+
environment-file: false
2316

2417
- name: Create env
2518
shell: bash -l {0}
2619
run: |
27-
conda create --yes --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge --strict-channel-priority
28-
source activate TEST
29-
pip install -e . --no-deps --force-reinstall
20+
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
22+
python -m pip install -e . --no-deps --force-reinstall
3023
3124
- name: Notebook tests
3225
shell: bash -l {0}
3326
run: |
34-
source activate TEST
35-
pytest --nbval-lax examples
27+
micromamba activate TEST
28+
python -m pytest --nbval-lax examples
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
name: Code Tests with Latest branca
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [main]
3+
on: [push, pull_request]
74

85
jobs:
96
run:
107
runs-on: ubuntu-latest
118

129
steps:
13-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1411

15-
- name: Setup Conda
16-
uses: s-weigand/setup-conda@v1
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v13
1714
with:
18-
activate-conda: false
19-
update-conda: true
20-
conda-channels: conda-forge
15+
environment-file: false
2116

2217
- name: Python 3.x
2318
shell: bash -l {0}
2419
run: |
25-
conda create --yes --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt
26-
source activate TEST
27-
pip install -e . --no-deps --force-reinstall
20+
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
22+
python -m pip install -e . --no-deps --force-reinstall
2823
2924
- name: Tests with latest branca
3025
shell: bash -l {0}
3126
run: |
32-
source activate TEST
33-
conda remove branca --yes
34-
pip install git+https://github.com/python-visualization/branca.git
35-
pytest -vv --ignore=tests/selenium
27+
micromamba activate TEST
28+
micromamba remove branca --yes
29+
python -m pip install git+https://github.com/python-visualization/branca.git
30+
python -m pytest -vv --ignore=tests/selenium

.github/workflows/test_selenium.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
name: Selenium Tests
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
on: [push, pull_request]
104

115
jobs:
126
run:
137
runs-on: ubuntu-latest
148

159
steps:
16-
- uses: actions/checkout@v2
17-
- name: Conda setup
18-
uses: s-weigand/setup-conda@v1
10+
- uses: actions/checkout@v3
11+
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v13
1914
with:
20-
update-conda: true
15+
environment-file: false
2116

22-
- name: Conda environment creation
17+
- name: Create env
2318
shell: bash -l {0}
2419
run: |
25-
conda create --yes --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge --strict-channel-priority
26-
source activate TEST
27-
pip install -e . --no-deps --force-reinstall
20+
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
22+
python -m pip install -e . --no-deps --force-reinstall
2823
2924
- name: Selenium tests
3025
shell: bash -l {0}
3126
run: |
32-
source activate TEST
33-
pytest tests/selenium -vv
27+
micromamba activate TEST
28+
python -m pytest tests/selenium -vv
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: Notebook Style Tests
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
on: [push, pull_request]
104

115
jobs:
126
run:
137
runs-on: ubuntu-latest
148

159
steps:
16-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1711

18-
- name: Setup Conda
19-
uses: s-weigand/setup-conda@v1
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v13
2014
with:
21-
activate-conda: false
22-
conda-channels: conda-forge
15+
environment-file: false
2316

2417
- name: Create env
2518
shell: bash -l {0}
2619
run: |
27-
conda create --yes --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge --strict-channel-priority
28-
source activate TEST
29-
pip install -e . --no-deps --force-reinstall
20+
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
22+
python -m pip install -e . --no-deps --force-reinstall
3023
3124
- name: Notebook coding standards tests
3225
shell: bash -l {0}
3326
run: |
34-
source activate TEST
35-
flake8-nb examples --ignore=W391,E226,E402,W504,I100,I201,I202,E703 --max-line-length=120 --show-source --count
27+
micromamba activate TEST
28+
for fname in examples/*.ipynb; do echo $fname $(flake8-nb $fname --ignore=W391,E226,E402,W504,I100,I201,I202,E703 --max-line-length=120 --show-source --count); done

folium/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
from folium.features import (
1818
Choropleth,
1919
ClickForMarker,
20+
ClickForLatLng,
2021
ColorLine,
2122
CustomIcon,
2223
DivIcon,
2324
GeoJson,
24-
GeoJsonTooltip,
2525
GeoJsonPopup,
26+
GeoJsonTooltip,
2627
LatLngPopup,
2728
RegularPolygonMarker,
2829
TopoJson,
@@ -75,6 +76,7 @@
7576
__all__ = [
7677
'Choropleth',
7778
'ClickForMarker',
79+
'ClickForLatLng',
7880
'ColorLine',
7981
'ColorMap',
8082
'CssLink',
@@ -86,6 +88,7 @@
8688
'Figure',
8789
'FitBounds',
8890
'GeoJson',
91+
'GeoJsonPopup',
8992
'GeoJsonTooltip',
9093
'Html',
9194
'IFrame',

folium/elements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from branca.element import Figure, Element, JavascriptLink, CssLink
1+
from branca.element import CssLink, Element, Figure, JavascriptLink
22

33

44
class JSCSSMixin(Element):

0 commit comments

Comments
 (0)