From e6b08bf93f8fab6843d8b404645a9e6adcf72178 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 3 Jan 2025 10:03:41 -0500 Subject: [PATCH] minor updates --- .pre-commit-config.yaml | 5 ++--- src/xsdata_pydantic_basemodel/compat.py | 12 ++---------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4305abbf..8837766e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,13 +10,13 @@ repos: - id: validate-pyproject - repo: https://github.com/crate-ci/typos - rev: codespell-dict-v0.5.0 + rev: v1.29.4 hooks: - id: typos args: [--force-exclude] # omit --write-changes - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.4 + rev: v0.8.5 hooks: - id: ruff args: [--fix, --unsafe-fixes] @@ -29,7 +29,6 @@ repos: exclude: ^tests|^docs|_napari_plugin|widgets additional_dependencies: - pydantic>=2.10 - - pydantic-compat - xsdata==24.2.1 - Pint - types-lxml diff --git a/src/xsdata_pydantic_basemodel/compat.py b/src/xsdata_pydantic_basemodel/compat.py index 30c181e0..6856156d 100644 --- a/src/xsdata_pydantic_basemodel/compat.py +++ b/src/xsdata_pydantic_basemodel/compat.py @@ -1,15 +1,7 @@ import dataclasses as dc from collections.abc import Iterator from contextlib import suppress -from typing import ( - TYPE_CHECKING, - Any, - Callable, - ClassVar, - Generic, - Optional, - TypeVar, -) +from typing import TYPE_CHECKING, Any, Callable, ClassVar, Generic, Optional, TypeVar from pydantic import BaseModel, Field from pydantic_core import core_schema as cs @@ -133,7 +125,7 @@ def validator(value: Any) -> Any: def _make_get_core_schema(validator: Callable) -> Callable: def get_core_schema(*args: Any) -> cs.PlainValidatorFunctionSchema: - return cs.general_plain_validator_function(validator) + return cs.with_info_plain_validator_function(validator) return get_core_schema