diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e0ea02de5..66a862b663 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,12 +15,12 @@ repos: files: requirements-dev.txt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black language_version: python3 diff --git a/folium/features.py b/folium/features.py index 586ce22110..f216a7b08b 100644 --- a/folium/features.py +++ b/folium/features.py @@ -517,9 +517,9 @@ class GeoJson(Layer): >>> # Provide a style_function that color all states green but Alabama. >>> style_function = lambda x: { - ... "fillColor": "#0000ff" - ... if x["properties"]["name"] == "Alabama" - ... else "#00ff00" + ... "fillColor": ( + ... "#0000ff" if x["properties"]["name"] == "Alabama" else "#00ff00" + ... ) ... } >>> GeoJson(geojson, style_function=style_function) @@ -947,9 +947,9 @@ class TopoJson(JSCSSMixin, Layer): >>> # Provide a style_function that color all states green but Alabama. >>> style_function = lambda x: { - ... "fillColor": "#0000ff" - ... if x["properties"]["name"] == "Alabama" - ... else "#00ff00" + ... "fillColor": ( + ... "#0000ff" if x["properties"]["name"] == "Alabama" else "#00ff00" + ... ) ... } >>> TopoJson(topo_json, "object.myobject", style_function=style_function) diff --git a/folium/map.py b/folium/map.py index e3356c2754..01ac7d2ede 100644 --- a/folium/map.py +++ b/folium/map.py @@ -2,6 +2,7 @@ Classes for drawing maps. """ + import warnings from collections import OrderedDict from typing import Dict, List, Optional, Sequence, Tuple, Type, Union diff --git a/folium/raster_layers.py b/folium/raster_layers.py index ea0e6d1809..ababe3fa94 100644 --- a/folium/raster_layers.py +++ b/folium/raster_layers.py @@ -2,6 +2,7 @@ Wraps leaflet TileLayer, WmsTileLayer (TileLayer.WMS), ImageOverlay, and VideoOverlay """ + from typing import Any, Callable, Optional, Union import xyzservices diff --git a/folium/vector_layers.py b/folium/vector_layers.py index 6e03506101..9f535467a4 100644 --- a/folium/vector_layers.py +++ b/folium/vector_layers.py @@ -2,6 +2,7 @@ Wraps leaflet Polyline, Polygon, Rectangle, Circle, and CircleMarker """ + from typing import List, Optional, Sequence, Union from branca.element import MacroElement diff --git a/tests/test_map.py b/tests/test_map.py index d38aa998fb..e67022d188 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -3,6 +3,7 @@ ---------------- """ + import warnings import numpy as np diff --git a/tests/test_raster_layers.py b/tests/test_raster_layers.py index 600d876647..dcef20c3aa 100644 --- a/tests/test_raster_layers.py +++ b/tests/test_raster_layers.py @@ -3,6 +3,7 @@ ------------------ """ + import pytest import xyzservices from jinja2 import Template