diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8737c96..3aaf2c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,13 +2,13 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black - rev: 24.2.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.5.1 hooks: - id: black diff --git a/src/cmake_parser/_internal.py b/src/cmake_parser/_internal.py index 86e83e4..1b9145d 100644 --- a/src/cmake_parser/_internal.py +++ b/src/cmake_parser/_internal.py @@ -16,6 +16,7 @@ """ Internal utility functions """ + from functools import wraps from warnings import warn from typing import ParamSpec, TypeVar @@ -25,9 +26,9 @@ _T = TypeVar("_T") -def deprecated_alias[ - _T, **_P -](new_func: Callable[_P, _T]) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]: +def deprecated_alias[_T, **_P]( + new_func: Callable[_P, _T], +) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]: def deprecated_alias_impl(old_func: Callable[_P, _T]) -> Callable[_P, _T]: @wraps(new_func) def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _T: diff --git a/src/cmake_parser/ast.py b/src/cmake_parser/ast.py index 1d654c3..add1db3 100644 --- a/src/cmake_parser/ast.py +++ b/src/cmake_parser/ast.py @@ -18,6 +18,7 @@ :func:`~cmake_parser.parser.parse_raw` and :func:`~cmake_parser.parser.parse_tree`. """ + from dataclasses import dataclass from collections.abc import Generator from .lexer import Token diff --git a/src/cmake_parser/parser.py b/src/cmake_parser/parser.py index 251ed54..f2f2ae7 100644 --- a/src/cmake_parser/parser.py +++ b/src/cmake_parser/parser.py @@ -15,6 +15,7 @@ """ Core functionality for parsing CMake code. """ + import re from functools import partial from collections.abc import Callable