diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 898f342..e1087e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.4.10' + rev: 'v0.5.0' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -68,7 +68,7 @@ repos: - flake8-typing-imports - flake8-use-fstring - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy additional_dependencies: diff --git a/pygeoif/factories.py b/pygeoif/factories.py index c139434..f20203a 100644 --- a/pygeoif/factories.py +++ b/pygeoif/factories.py @@ -53,7 +53,7 @@ "GEOMETRYCOLLECTION)" r"[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$" ), - flags=re.I, + flags=re.IGNORECASE, ) gcre: Pattern[str] = re.compile( r"POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON", @@ -92,7 +92,7 @@ def box( """Return a rectangular polygon with configurable normal vector.""" coords = [(maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny)] if not ccw: - coords = coords[::-1] + coords.reverse() return Polygon(coords) @@ -188,7 +188,7 @@ def _line_from_wkt_coordinates(coordinates: str) -> LineString: coords = coordinates.split(",") return LineString( cast( - LineType, # + LineType, [tuple(num(c) for c in coord.split()) for coord in coords], ), )