diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f52eee00..d6725d46c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,19 +20,19 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black-pre-commit-mirror - rev: "26.5.1" + rev: "26.10.1" hooks: - id: black args: [--preview, --enable-unstable-feature, string_processing] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.17.6 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v2.1.0" + rev: "v2.4.1" hooks: - id: mypy additional_dependencies: diff --git a/src/dolphin/io/_core.py b/src/dolphin/io/_core.py index b4d6ff267..ffe42713c 100644 --- a/src/dolphin/io/_core.py +++ b/src/dolphin/io/_core.py @@ -37,7 +37,6 @@ "copy_projection", "format_nc_filename", "get_raster_bounds", - "get_raster_bounds", "get_raster_chunk_size", "get_raster_crs", "get_raster_description", diff --git a/src/dolphin/stitching.py b/src/dolphin/stitching.py index f15d82d86..f57f73c4c 100644 --- a/src/dolphin/stitching.py +++ b/src/dolphin/stitching.py @@ -4,13 +4,13 @@ import logging import math -import os import re import subprocess import tempfile from collections.abc import Mapping from datetime import datetime from os import fspath +from os.path import commonpath from pathlib import Path from typing import Iterable, Optional, Sequence @@ -730,7 +730,7 @@ def _common_prefix_before_first_date(files: Sequence[Path], file_date_fmt: str) candidates.append(stem[: m.start()] if m else stem) if not candidates: return "" - prefix = os.path.commonprefix(candidates) + prefix = commonpath(candidates) # tidy trailing separators; preserve '_' if it already exists prefix = re.sub(r"[-.\s]+$", "", prefix) return prefix