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
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pre-commit

on: [push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
env:
FORCE_COLOR: "1"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: ' '
- uses: pre-commit/action@v3.0.0
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*


- name: Install build tools
run: |
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exclude: examples/data/|.*\.css|.*\.json|.*\.geojson|.*\.html

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-added-large-files
- id: requirements-txt-fixer
- id: file-contents-sorter
files: requirements-dev.txt

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
exclude: docs/conf.py
args: [--max-line-length=120]
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Bug fixes
- Fix HeatMapWithTime plugin (@farisnanosoft @conengmo #1228)
- Fix adding GeoJSON to MarkerCluster (@conengmo #1190)

Documentation
Documentation

- Typo corrections in examples/Colormaps.ipynb (@nik-ahuja #1215)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.. |DOI| image:: https://zenodo.org/badge/18669/python-visualization/folium.svg
:target: https://zenodo.org/badge/latestdoi/18669/python-visualization/folium
:alt: DOI

.. |binder| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/python-visualization/folium/main?filepath=examples

Expand All @@ -28,7 +28,7 @@ Python Data, Leaflet.js Maps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`folium` builds on the data wrangling strengths of the Python ecosystem and the
mapping strengths of the Leaflet.js library. Manipulate your data in Python,
mapping strengths of the Leaflet.js library. Manipulate your data in Python,
then visualize it in a Leaflet map via `folium`.

Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The trick is to return folium's HTML representation.
Here is an example on how to do that:


.. literalinclude:: ../examples/flask_example.py
.. literalinclude:: ../examples/flask_example.py
14 changes: 7 additions & 7 deletions folium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@
if sys.version_info < (3, 0):
raise ImportError(
"""You are running folium {} on Python 2

folium 0.9 and above are no longer compatible with Python 2, but somehow
you got this version anyway. Make sure you have pip >= 9.0 to avoid this
kind of issue, as well as setuptools >= 24.2:

$ pip install pip setuptools --upgrade

Your choices:

- Upgrade to Python 3.

- Install an older version of folium:

$ pip install 'folium<0.9.0'

""".format(__version__)) # noqa

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion folium/plugins/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Search(JSCSSMixin, MacroElement):
{% endif %}
collapsed: {{this.collapsed|tojson|safe}},
textPlaceholder: '{{this.placeholder}}',
position:'{{this.position}}',
position:'{{this.position}}',
{% if this.geom_type == 'Point' %}
initial: false,
{% if this.search_zoom %}
Expand Down
2 changes: 1 addition & 1 deletion folium/templates/leaflet_heat.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion folium/templates/tiles/stamentonerbackground/attr.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
2 changes: 1 addition & 1 deletion folium/templates/tiles/stamentonerlabels/attr.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ pytest-cov
pytest-flake8
pytest-xdist
scipy
setuptools_scm
selenium
setuptools_scm
sphinx
twine>=3.2.0
wheel
vega_datasets
vincent
vincent
wheel
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license_file = LICENSE.txt
universal = 1

[check-manifest]
ignore =
ignore =
*.yml
docs
docs/*
Expand Down
1 change: 0 additions & 1 deletion tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ def test_geojson_marker():
).add_to(m)



def test_geojson_find_identifier():

def _create(*properties):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_raster_layers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""
Test raster_layers
-----------------
------------------

"""
import pytest

import folium
from folium.utilities import normalize

Expand Down