Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pydantic for openSUSE:Factory checked in at 2024-06-25 23:06:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pydantic (Old) and /work/SRC/openSUSE:Factory/.python-pydantic.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-pydantic" Tue Jun 25 23:06:41 2024 rev:28 rq:1183039 version:2.7.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pydantic/python-pydantic.changes 2024-06-07 15:02:47.714523522 +0200 +++ /work/SRC/openSUSE:Factory/.python-pydantic.new.18349/python-pydantic.changes 2024-06-25 23:06:59.869256574 +0200 @@ -1,0 +2,7 @@ +Mon Jun 24 15:45:05 UTC 2024 - Dirk Müller <dmueller@suse.com> + +- update to 2.7.4: + * Bump `pydantic.v1` to `v1.10.16` reference + * Specify `recursive_guard` as kwarg in `FutureRef._evaluate` + +------------------------------------------------------------------- Old: ---- pydantic-2.7.3.tar.gz New: ---- pydantic-2.7.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pydantic.spec ++++++ --- /var/tmp/diff_new_pack.djlaL4/_old 2024-06-25 23:07:00.609283634 +0200 +++ /var/tmp/diff_new_pack.djlaL4/_new 2024-06-25 23:07:00.609283634 +0200 @@ -27,7 +27,7 @@ %endif %{?sle15_python_module_pythons} Name: python-pydantic%{psuffix} -Version: 2.7.3 +Version: 2.7.4 Release: 0 Summary: Data validation and settings management using python type hinting License: MIT ++++++ pydantic-2.7.3.tar.gz -> pydantic-2.7.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/HISTORY.md new/pydantic-2.7.4/HISTORY.md --- old/pydantic-2.7.3/HISTORY.md 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/HISTORY.md 2024-06-12 15:44:13.000000000 +0200 @@ -1,3 +1,17 @@ +## v2.7.4 (2024-06-12) + +[Github release](https://github.com/pydantic/pydantic/releases/tag/v2.7.4) + +### What's Changed + +#### Packaging + +* Bump `pydantic.v1` to `v1.10.16` reference by @sydney-runkle in [#9639](https://github.com/pydantic/pydantic/pull/9639) + +#### Fixes + +* Specify `recursive_guard` as kwarg in `FutureRef._evaluate` by @vfazio in [#9612](https://github.com/pydantic/pydantic/pull/9612) + ## v2.7.3 (2024-06-03) [GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.7.3) @@ -992,6 +1006,11 @@ <!-- package description limit --> +## v1.10.16 (2024-06-11) + +* Specify recursive_guard as kwarg in FutureRef._evaluate by @vfazio in https://github.com/pydantic/pydantic/pull/9612 +* Fix mypy v1 plugin for upcoming mypy release by @ cdce8p in https://github.com/pydantic/pydantic/pull/9586 +* Import modules/objects directly from v1 namespace by @exs-dwoodward in https://github.com/pydantic/pydantic/pull/9162 ## v1.10.15 (2024-04-03) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/__init__.py new/pydantic-2.7.4/pydantic/v1/__init__.py --- old/pydantic-2.7.3/pydantic/v1/__init__.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/__init__.py 2024-06-12 15:44:13.000000000 +0200 @@ -1,24 +1,24 @@ # flake8: noqa -from . import dataclasses -from .annotated_types import create_model_from_namedtuple, create_model_from_typeddict -from .class_validators import root_validator, validator -from .config import BaseConfig, ConfigDict, Extra -from .decorator import validate_arguments -from .env_settings import BaseSettings -from .error_wrappers import ValidationError -from .errors import * -from .fields import Field, PrivateAttr, Required -from .main import * -from .networks import * -from .parse import Protocol -from .tools import * -from .types import * -from .version import VERSION, compiled +from pydantic.v1 import dataclasses +from pydantic.v1.annotated_types import create_model_from_namedtuple, create_model_from_typeddict +from pydantic.v1.class_validators import root_validator, validator +from pydantic.v1.config import BaseConfig, ConfigDict, Extra +from pydantic.v1.decorator import validate_arguments +from pydantic.v1.env_settings import BaseSettings +from pydantic.v1.error_wrappers import ValidationError +from pydantic.v1.errors import * +from pydantic.v1.fields import Field, PrivateAttr, Required +from pydantic.v1.main import * +from pydantic.v1.networks import * +from pydantic.v1.parse import Protocol +from pydantic.v1.tools import * +from pydantic.v1.types import * +from pydantic.v1.version import VERSION, compiled __version__ = VERSION -# WARNING __all__ from .errors is not included here, it will be removed as an export here in v2 -# please use "from pydantic.errors import ..." instead +# WARNING __all__ from pydantic.errors is not included here, it will be removed as an export here in v2 +# please use "from pydantic.v1.errors import ..." instead __all__ = [ # annotated types utils 'create_model_from_namedtuple', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/_hypothesis_plugin.py new/pydantic-2.7.4/pydantic/v1/_hypothesis_plugin.py --- old/pydantic-2.7.3/pydantic/v1/_hypothesis_plugin.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/_hypothesis_plugin.py 2024-06-12 15:44:13.000000000 +0200 @@ -35,7 +35,7 @@ import pydantic import pydantic.color import pydantic.types -from pydantic.utils import lenient_issubclass +from pydantic.v1.utils import lenient_issubclass # FilePath and DirectoryPath are explicitly unsupported, as we'd have to create # them on-disk, and that's unsafe in general without being told *where* to do so. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/annotated_types.py new/pydantic-2.7.4/pydantic/v1/annotated_types.py --- old/pydantic-2.7.3/pydantic/v1/annotated_types.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/annotated_types.py 2024-06-12 15:44:13.000000000 +0200 @@ -1,9 +1,9 @@ import sys from typing import TYPE_CHECKING, Any, Dict, FrozenSet, NamedTuple, Type -from .fields import Required -from .main import BaseModel, create_model -from .typing import is_typeddict, is_typeddict_special +from pydantic.v1.fields import Required +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.typing import is_typeddict, is_typeddict_special if TYPE_CHECKING: from typing_extensions import TypedDict diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/class_validators.py new/pydantic-2.7.4/pydantic/v1/class_validators.py --- old/pydantic-2.7.3/pydantic/v1/class_validators.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/class_validators.py 2024-06-12 15:44:13.000000000 +0200 @@ -5,12 +5,12 @@ from types import FunctionType from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload -from .errors import ConfigError -from .typing import AnyCallable -from .utils import ROOT_KEY, in_ipython +from pydantic.v1.errors import ConfigError +from pydantic.v1.typing import AnyCallable +from pydantic.v1.utils import ROOT_KEY, in_ipython if TYPE_CHECKING: - from .typing import AnyClassMethod + from pydantic.v1.typing import AnyClassMethod class Validator: @@ -36,9 +36,9 @@ if TYPE_CHECKING: from inspect import Signature - from .config import BaseConfig - from .fields import ModelField - from .types import ModelOrDc + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.types import ModelOrDc ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any] ValidatorsList = List[ValidatorCallable] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/color.py new/pydantic-2.7.4/pydantic/v1/color.py --- old/pydantic-2.7.3/pydantic/v1/color.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/color.py 2024-06-12 15:44:13.000000000 +0200 @@ -12,11 +12,11 @@ from colorsys import hls_to_rgb, rgb_to_hls from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast -from .errors import ColorError -from .utils import Representation, almost_equal_floats +from pydantic.v1.errors import ColorError +from pydantic.v1.utils import Representation, almost_equal_floats if TYPE_CHECKING: - from .typing import CallableGenerator, ReprArgs + from pydantic.v1.typing import CallableGenerator, ReprArgs ColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]] ColorType = Union[ColorTuple, str] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/config.py new/pydantic-2.7.4/pydantic/v1/config.py --- old/pydantic-2.7.3/pydantic/v1/config.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/config.py 2024-06-12 15:44:13.000000000 +0200 @@ -4,15 +4,15 @@ from typing_extensions import Literal, Protocol -from .typing import AnyArgTCallable, AnyCallable -from .utils import GetterDict -from .version import compiled +from pydantic.v1.typing import AnyArgTCallable, AnyCallable +from pydantic.v1.utils import GetterDict +from pydantic.v1.version import compiled if TYPE_CHECKING: from typing import overload - from .fields import ModelField - from .main import BaseModel + from pydantic.v1.fields import ModelField + from pydantic.v1.main import BaseModel ConfigType = Type['BaseConfig'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/dataclasses.py new/pydantic-2.7.4/pydantic/v1/dataclasses.py --- old/pydantic-2.7.3/pydantic/v1/dataclasses.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/dataclasses.py 2024-06-12 15:44:13.000000000 +0200 @@ -47,17 +47,17 @@ from typing_extensions import dataclass_transform -from .class_validators import gather_all_validators -from .config import BaseConfig, ConfigDict, Extra, get_config -from .error_wrappers import ValidationError -from .errors import DataclassTypeError -from .fields import Field, FieldInfo, Required, Undefined -from .main import create_model, validate_model -from .utils import ClassAttribute +from pydantic.v1.class_validators import gather_all_validators +from pydantic.v1.config import BaseConfig, ConfigDict, Extra, get_config +from pydantic.v1.error_wrappers import ValidationError +from pydantic.v1.errors import DataclassTypeError +from pydantic.v1.fields import Field, FieldInfo, Required, Undefined +from pydantic.v1.main import create_model, validate_model +from pydantic.v1.utils import ClassAttribute if TYPE_CHECKING: - from .main import BaseModel - from .typing import CallableGenerator, NoArgAnyCallable + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import CallableGenerator, NoArgAnyCallable DataclassT = TypeVar('DataclassT', bound='Dataclass') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/datetime_parse.py new/pydantic-2.7.4/pydantic/v1/datetime_parse.py --- old/pydantic-2.7.3/pydantic/v1/datetime_parse.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/datetime_parse.py 2024-06-12 15:44:13.000000000 +0200 @@ -18,7 +18,7 @@ from datetime import date, datetime, time, timedelta, timezone from typing import Dict, Optional, Type, Union -from . import errors +from pydantic.v1 import errors date_expr = r'(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})' time_expr = ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/decorator.py new/pydantic-2.7.4/pydantic/v1/decorator.py --- old/pydantic-2.7.3/pydantic/v1/decorator.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/decorator.py 2024-06-12 15:44:13.000000000 +0200 @@ -1,17 +1,17 @@ from functools import wraps from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload -from . import validator -from .config import Extra -from .errors import ConfigError -from .main import BaseModel, create_model -from .typing import get_all_type_hints -from .utils import to_camel +from pydantic.v1 import validator +from pydantic.v1.config import Extra +from pydantic.v1.errors import ConfigError +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.typing import get_all_type_hints +from pydantic.v1.utils import to_camel __all__ = ('validate_arguments',) if TYPE_CHECKING: - from .typing import AnyCallable + from pydantic.v1.typing import AnyCallable AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable) ConfigType = Union[None, Type[Any], Dict[str, Any]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/env_settings.py new/pydantic-2.7.4/pydantic/v1/env_settings.py --- old/pydantic-2.7.3/pydantic/v1/env_settings.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/env_settings.py 2024-06-12 15:44:13.000000000 +0200 @@ -3,12 +3,12 @@ from pathlib import Path from typing import AbstractSet, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Tuple, Type, Union -from .config import BaseConfig, Extra -from .fields import ModelField -from .main import BaseModel -from .types import JsonWrapper -from .typing import StrPath, display_as_type, get_origin, is_union -from .utils import deep_update, lenient_issubclass, path_type, sequence_like +from pydantic.v1.config import BaseConfig, Extra +from pydantic.v1.fields import ModelField +from pydantic.v1.main import BaseModel +from pydantic.v1.types import JsonWrapper +from pydantic.v1.typing import StrPath, display_as_type, get_origin, is_union +from pydantic.v1.utils import deep_update, lenient_issubclass, path_type, sequence_like env_file_sentinel = str(object()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/error_wrappers.py new/pydantic-2.7.4/pydantic/v1/error_wrappers.py --- old/pydantic-2.7.3/pydantic/v1/error_wrappers.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/error_wrappers.py 2024-06-12 15:44:13.000000000 +0200 @@ -1,15 +1,15 @@ import json from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, Union -from .json import pydantic_encoder -from .utils import Representation +from pydantic.v1.json import pydantic_encoder +from pydantic.v1.utils import Representation if TYPE_CHECKING: from typing_extensions import TypedDict - from .config import BaseConfig - from .types import ModelOrDc - from .typing import ReprArgs + from pydantic.v1.config import BaseConfig + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import ReprArgs Loc = Tuple[Union[int, str], ...] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/errors.py new/pydantic-2.7.4/pydantic/v1/errors.py --- old/pydantic-2.7.3/pydantic/v1/errors.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/errors.py 2024-06-12 15:44:13.000000000 +0200 @@ -2,12 +2,12 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union -from .typing import display_as_type +from pydantic.v1.typing import display_as_type if TYPE_CHECKING: - from .typing import DictStrAny + from pydantic.v1.typing import DictStrAny -# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc. +# explicitly state exports to avoid "from pydantic.v1.errors import *" also importing Decimal, Path etc. __all__ = ( 'PydanticTypeError', 'PydanticValueError', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/fields.py new/pydantic-2.7.4/pydantic/v1/fields.py --- old/pydantic-2.7.3/pydantic/v1/fields.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/fields.py 2024-06-12 15:44:13.000000000 +0200 @@ -28,12 +28,12 @@ from typing_extensions import Annotated, Final -from . import errors as errors_ -from .class_validators import Validator, make_generic_validator, prep_validators -from .error_wrappers import ErrorWrapper -from .errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError -from .types import Json, JsonWrapper -from .typing import ( +from pydantic.v1 import errors as errors_ +from pydantic.v1.class_validators import Validator, make_generic_validator, prep_validators +from pydantic.v1.error_wrappers import ErrorWrapper +from pydantic.v1.errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError +from pydantic.v1.types import Json, JsonWrapper +from pydantic.v1.typing import ( NoArgAnyCallable, convert_generics, display_as_type, @@ -48,7 +48,7 @@ is_union, new_type_supertype, ) -from .utils import ( +from pydantic.v1.utils import ( PyObjectStr, Representation, ValueItems, @@ -59,7 +59,7 @@ sequence_like, smart_deepcopy, ) -from .validators import constant_validator, dict_validator, find_validators, validate_json +from pydantic.v1.validators import constant_validator, dict_validator, find_validators, validate_json Required: Any = Ellipsis @@ -83,11 +83,11 @@ Undefined = UndefinedType() if TYPE_CHECKING: - from .class_validators import ValidatorsList - from .config import BaseConfig - from .error_wrappers import ErrorList - from .types import ModelOrDc - from .typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs + from pydantic.v1.class_validators import ValidatorsList + from pydantic.v1.config import BaseConfig + from pydantic.v1.error_wrappers import ErrorList + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs ValidateReturn = Tuple[Optional[Any], Optional[ErrorList]] LocStr = Union[Tuple[Union[int, str], ...], str] @@ -490,7 +490,7 @@ class_validators: Optional[Dict[str, Validator]], config: Type['BaseConfig'], ) -> 'ModelField': - from .schema import get_annotation_from_field_info + from pydantic.v1.schema import get_annotation_from_field_info field_info, value = cls._get_field_info(name, annotation, value, config) required: 'BoolUndefined' = Undefined @@ -1160,7 +1160,7 @@ """ Whether the field is "complex" eg. env variables should be parsed as JSON. """ - from .main import BaseModel + from pydantic.v1.main import BaseModel return ( self.shape != SHAPE_SINGLETON diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/generics.py new/pydantic-2.7.4/pydantic/v1/generics.py --- old/pydantic-2.7.3/pydantic/v1/generics.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/generics.py 2024-06-12 15:44:13.000000000 +0200 @@ -22,12 +22,12 @@ from typing_extensions import Annotated, Literal as ExtLiteral -from .class_validators import gather_all_validators -from .fields import DeferredType -from .main import BaseModel, create_model -from .types import JsonWrapper -from .typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base -from .utils import all_identical, lenient_issubclass +from pydantic.v1.class_validators import gather_all_validators +from pydantic.v1.fields import DeferredType +from pydantic.v1.main import BaseModel, create_model +from pydantic.v1.types import JsonWrapper +from pydantic.v1.typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base +from pydantic.v1.utils import all_identical, lenient_issubclass if sys.version_info >= (3, 10): from typing import _UnionGenericAlias diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/json.py new/pydantic-2.7.4/pydantic/v1/json.py --- old/pydantic-2.7.3/pydantic/v1/json.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/json.py 2024-06-12 15:44:13.000000000 +0200 @@ -9,9 +9,9 @@ from typing import Any, Callable, Dict, Type, Union from uuid import UUID -from .color import Color -from .networks import NameEmail -from .types import SecretBytes, SecretStr +from pydantic.v1.color import Color +from pydantic.v1.networks import NameEmail +from pydantic.v1.types import SecretBytes, SecretStr __all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat' @@ -72,7 +72,7 @@ def pydantic_encoder(obj: Any) -> Any: from dataclasses import asdict, is_dataclass - from .main import BaseModel + from pydantic.v1.main import BaseModel if isinstance(obj, BaseModel): return obj.dict() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/main.py new/pydantic-2.7.4/pydantic/v1/main.py --- old/pydantic-2.7.3/pydantic/v1/main.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/main.py 2024-06-12 15:44:13.000000000 +0200 @@ -26,11 +26,11 @@ from typing_extensions import dataclass_transform -from .class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators -from .config import BaseConfig, Extra, inherit_config, prepare_config -from .error_wrappers import ErrorWrapper, ValidationError -from .errors import ConfigError, DictError, ExtraError, MissingError -from .fields import ( +from pydantic.v1.class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators +from pydantic.v1.config import BaseConfig, Extra, inherit_config, prepare_config +from pydantic.v1.error_wrappers import ErrorWrapper, ValidationError +from pydantic.v1.errors import ConfigError, DictError, ExtraError, MissingError +from pydantic.v1.fields import ( MAPPING_LIKE_SHAPES, Field, ModelField, @@ -39,11 +39,11 @@ Undefined, is_finalvar_with_default_val, ) -from .json import custom_pydantic_encoder, pydantic_encoder -from .parse import Protocol, load_file, load_str_bytes -from .schema import default_ref_template, model_schema -from .types import PyObject, StrBytes -from .typing import ( +from pydantic.v1.json import custom_pydantic_encoder, pydantic_encoder +from pydantic.v1.parse import Protocol, load_file, load_str_bytes +from pydantic.v1.schema import default_ref_template, model_schema +from pydantic.v1.types import PyObject, StrBytes +from pydantic.v1.typing import ( AnyCallable, get_args, get_origin, @@ -53,7 +53,7 @@ resolve_annotations, update_model_forward_refs, ) -from .utils import ( +from pydantic.v1.utils import ( DUNDER_ATTRIBUTES, ROOT_KEY, ClassAttribute, @@ -73,9 +73,9 @@ if TYPE_CHECKING: from inspect import Signature - from .class_validators import ValidatorListDict - from .types import ModelOrDc - from .typing import ( + from pydantic.v1.class_validators import ValidatorListDict + from pydantic.v1.types import ModelOrDc + from pydantic.v1.typing import ( AbstractSetIntStr, AnyClassMethod, CallableGenerator, @@ -669,7 +669,7 @@ def schema_json( cls, *, by_alias: bool = True, ref_template: str = default_ref_template, **dumps_kwargs: Any ) -> str: - from .json import pydantic_encoder + from pydantic.v1.json import pydantic_encoder return cls.__config__.json_dumps( cls.schema(by_alias=by_alias, ref_template=ref_template), default=pydantic_encoder, **dumps_kwargs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/mypy.py new/pydantic-2.7.4/pydantic/v1/mypy.py --- old/pydantic-2.7.3/pydantic/v1/mypy.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/mypy.py 2024-06-12 15:44:13.000000000 +0200 @@ -57,6 +57,7 @@ Type, TypeOfAny, TypeType, + TypeVarId, TypeVarType, UnionType, get_proper_type, @@ -65,7 +66,7 @@ from mypy.util import get_unique_redefinition_name from mypy.version import __version__ as mypy_version -from .utils import is_valid_field +from pydantic.v1.utils import is_valid_field try: from mypy.types import TypeVarDef # type: ignore[attr-defined] @@ -498,7 +499,7 @@ tvd = TypeVarType( self_tvar_name, tvar_fullname, - -1, + TypeVarId(-1), [], obj_type, AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/networks.py new/pydantic-2.7.4/pydantic/v1/networks.py --- old/pydantic-2.7.3/pydantic/v1/networks.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/networks.py 2024-06-12 15:44:13.000000000 +0200 @@ -27,17 +27,17 @@ no_type_check, ) -from . import errors -from .utils import Representation, update_not_none -from .validators import constr_length_validator, str_validator +from pydantic.v1 import errors +from pydantic.v1.utils import Representation, update_not_none +from pydantic.v1.validators import constr_length_validator, str_validator if TYPE_CHECKING: import email_validator from typing_extensions import TypedDict - from .config import BaseConfig - from .fields import ModelField - from .typing import AnyCallable + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.typing import AnyCallable CallableGenerator = Generator[AnyCallable, None, None] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/parse.py new/pydantic-2.7.4/pydantic/v1/parse.py --- old/pydantic-2.7.3/pydantic/v1/parse.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/parse.py 2024-06-12 15:44:13.000000000 +0200 @@ -4,7 +4,7 @@ from pathlib import Path from typing import Any, Callable, Union -from .types import StrBytes +from pydantic.v1.types import StrBytes class Protocol(str, Enum): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/schema.py new/pydantic-2.7.4/pydantic/v1/schema.py --- old/pydantic-2.7.3/pydantic/v1/schema.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/schema.py 2024-06-12 15:44:13.000000000 +0200 @@ -31,7 +31,7 @@ from typing_extensions import Annotated, Literal -from .fields import ( +from pydantic.v1.fields import ( MAPPING_LIKE_SHAPES, SHAPE_DEQUE, SHAPE_FROZENSET, @@ -46,9 +46,9 @@ FieldInfo, ModelField, ) -from .json import pydantic_encoder -from .networks import AnyUrl, EmailStr -from .types import ( +from pydantic.v1.json import pydantic_encoder +from pydantic.v1.networks import AnyUrl, EmailStr +from pydantic.v1.types import ( ConstrainedDecimal, ConstrainedFloat, ConstrainedFrozenSet, @@ -69,7 +69,7 @@ conset, constr, ) -from .typing import ( +from pydantic.v1.typing import ( all_literal_values, get_args, get_origin, @@ -80,11 +80,11 @@ is_none_type, is_union, ) -from .utils import ROOT_KEY, get_model, lenient_issubclass +from pydantic.v1.utils import ROOT_KEY, get_model, lenient_issubclass if TYPE_CHECKING: - from .dataclasses import Dataclass - from .main import BaseModel + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.main import BaseModel default_prefix = '#/definitions/' default_ref_template = '#/definitions/{model}' @@ -378,7 +378,7 @@ :param known_models: used to solve circular references :return: a set with the model used in the declaration for this field, if any, and all its sub-models """ - from .main import BaseModel + from pydantic.v1.main import BaseModel flat_models: TypeModelSet = set() @@ -445,7 +445,7 @@ Take a single ``field`` and generate the schema for its type only, not including additional information as title, etc. Also return additional schema definitions, from sub-models. """ - from .main import BaseModel # noqa: F811 + from pydantic.v1.main import BaseModel # noqa: F811 definitions = {} nested_models: Set[str] = set() @@ -838,7 +838,7 @@ Take a single Pydantic ``ModelField``, and return its schema and any additional definitions from sub-models. """ - from .main import BaseModel + from pydantic.v1.main import BaseModel definitions: Dict[str, Any] = {} nested_models: Set[str] = set() @@ -974,7 +974,7 @@ def encode_default(dft: Any) -> Any: - from .main import BaseModel + from pydantic.v1.main import BaseModel if isinstance(dft, BaseModel) or is_dataclass(dft): dft = cast('dict[str, Any]', pydantic_encoder(dft)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/tools.py new/pydantic-2.7.4/pydantic/v1/tools.py --- old/pydantic-2.7.3/pydantic/v1/tools.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/tools.py 2024-06-12 15:44:13.000000000 +0200 @@ -3,16 +3,16 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypeVar, Union -from .parse import Protocol, load_file, load_str_bytes -from .types import StrBytes -from .typing import display_as_type +from pydantic.v1.parse import Protocol, load_file, load_str_bytes +from pydantic.v1.types import StrBytes +from pydantic.v1.typing import display_as_type __all__ = ('parse_file_as', 'parse_obj_as', 'parse_raw_as', 'schema_of', 'schema_json_of') NameFactory = Union[str, Callable[[Type[Any]], str]] if TYPE_CHECKING: - from .typing import DictStrAny + from pydantic.v1.typing import DictStrAny def _generate_parsing_type_name(type_: Any) -> str: @@ -21,7 +21,7 @@ @lru_cache(maxsize=2048) def _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any: - from .main import create_model + from pydantic.v1.main import create_model if type_name is None: type_name = _generate_parsing_type_name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/types.py new/pydantic-2.7.4/pydantic/v1/types.py --- old/pydantic-2.7.3/pydantic/v1/types.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/types.py 2024-06-12 15:44:13.000000000 +0200 @@ -28,10 +28,10 @@ from uuid import UUID from weakref import WeakSet -from . import errors -from .datetime_parse import parse_date -from .utils import import_string, update_not_none -from .validators import ( +from pydantic.v1 import errors +from pydantic.v1.datetime_parse import parse_date +from pydantic.v1.utils import import_string, update_not_none +from pydantic.v1.validators import ( bytes_validator, constr_length_validator, constr_lower, @@ -123,9 +123,9 @@ if TYPE_CHECKING: from typing_extensions import Annotated - from .dataclasses import Dataclass - from .main import BaseModel - from .typing import CallableGenerator + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import CallableGenerator ModelOrDc = Type[Union[BaseModel, Dataclass]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/typing.py new/pydantic-2.7.4/pydantic/v1/typing.py --- old/pydantic-2.7.3/pydantic/v1/typing.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/typing.py 2024-06-12 15:44:13.000000000 +0200 @@ -63,7 +63,9 @@ def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any: # Even though it is the right signature for python 3.9, mypy complains with # `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast... - return cast(Any, type_)._evaluate(globalns, localns, set()) + # Python 3.13/3.12.4+ made `recursive_guard` a kwarg, so name it explicitly to avoid: + # TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' + return cast(Any, type_)._evaluate(globalns, localns, recursive_guard=set()) if sys.version_info < (3, 9): @@ -256,7 +258,7 @@ if TYPE_CHECKING: - from .fields import ModelField + from pydantic.v1.fields import ModelField TupleGenerator = Generator[Tuple[str, Any], None, None] DictStrAny = Dict[str, Any] @@ -435,7 +437,7 @@ Check if a given class is a named tuple. It can be either a `typing.NamedTuple` or `collections.namedtuple` """ - from .utils import lenient_issubclass + from pydantic.v1.utils import lenient_issubclass return lenient_issubclass(type_, tuple) and hasattr(type_, '_fields') @@ -445,7 +447,7 @@ Check if a given class is a typed dict (from `typing` or `typing_extensions`) In 3.10, there will be a public method (https://docs.python.org/3.10/library/typing.html#typing.is_typeddict) """ - from .utils import lenient_issubclass + from pydantic.v1.utils import lenient_issubclass return lenient_issubclass(type_, dict) and hasattr(type_, '__total__') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/utils.py new/pydantic-2.7.4/pydantic/v1/utils.py --- old/pydantic-2.7.3/pydantic/v1/utils.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/utils.py 2024-06-12 15:44:13.000000000 +0200 @@ -28,8 +28,8 @@ from typing_extensions import Annotated -from .errors import ConfigError -from .typing import ( +from pydantic.v1.errors import ConfigError +from pydantic.v1.typing import ( NoneType, WithArgsTypes, all_literal_values, @@ -39,17 +39,17 @@ is_literal_type, is_union, ) -from .version import version_info +from pydantic.v1.version import version_info if TYPE_CHECKING: from inspect import Signature from pathlib import Path - from .config import BaseConfig - from .dataclasses import Dataclass - from .fields import ModelField - from .main import BaseModel - from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs + from pydantic.v1.config import BaseConfig + from pydantic.v1.dataclasses import Dataclass + from pydantic.v1.fields import ModelField + from pydantic.v1.main import BaseModel + from pydantic.v1.typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]] @@ -240,7 +240,7 @@ """ from inspect import Parameter, Signature, signature - from .config import Extra + from pydantic.v1.config import Extra present_params = signature(init).parameters.values() merged_params: Dict[str, Parameter] = {} @@ -298,7 +298,7 @@ def get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']: - from .main import BaseModel + from pydantic.v1.main import BaseModel try: model_cls = obj.__pydantic_model__ # type: ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/v1.py new/pydantic-2.7.4/pydantic/v1/v1.py --- old/pydantic-2.7.3/pydantic/v1/v1.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/v1.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,116 +0,0 @@ -# NOTE This file aliases the pydantic namespace as pydantic.v1 for smoother v1 -> v2 transition -# flake8: noqa -from pydantic import * - -# WARNING __all__ from .errors is not included here, it will be removed as an export here in v2 -# please use "from pydantic.errors import ..." instead -__all__ = [ - # annotated types utils - "create_model_from_namedtuple", - "create_model_from_typeddict", - # dataclasses - "dataclasses", - # class_validators - "root_validator", - "validator", - # config - "BaseConfig", - "ConfigDict", - "Extra", - # decorator - "validate_arguments", - # env_settings - "BaseSettings", - # error_wrappers - "ValidationError", - # fields - "Field", - "Required", - # main - "BaseModel", - "create_model", - "validate_model", - # network - "AnyUrl", - "AnyHttpUrl", - "FileUrl", - "HttpUrl", - "stricturl", - "EmailStr", - "NameEmail", - "IPvAnyAddress", - "IPvAnyInterface", - "IPvAnyNetwork", - "PostgresDsn", - "CockroachDsn", - "AmqpDsn", - "RedisDsn", - "MongoDsn", - "KafkaDsn", - "validate_email", - # parse - "Protocol", - # tools - "parse_file_as", - "parse_obj_as", - "parse_raw_as", - "schema_of", - "schema_json_of", - # types - "NoneStr", - "NoneBytes", - "StrBytes", - "NoneStrBytes", - "StrictStr", - "ConstrainedBytes", - "conbytes", - "ConstrainedList", - "conlist", - "ConstrainedSet", - "conset", - "ConstrainedFrozenSet", - "confrozenset", - "ConstrainedStr", - "constr", - "PyObject", - "ConstrainedInt", - "conint", - "PositiveInt", - "NegativeInt", - "NonNegativeInt", - "NonPositiveInt", - "ConstrainedFloat", - "confloat", - "PositiveFloat", - "NegativeFloat", - "NonNegativeFloat", - "NonPositiveFloat", - "FiniteFloat", - "ConstrainedDecimal", - "condecimal", - "ConstrainedDate", - "condate", - "UUID1", - "UUID3", - "UUID4", - "UUID5", - "FilePath", - "DirectoryPath", - "Json", - "JsonWrapper", - "SecretField", - "SecretStr", - "SecretBytes", - "StrictBool", - "StrictBytes", - "StrictInt", - "StrictFloat", - "PaymentCardNumber", - "PrivateAttr", - "ByteSize", - "PastDate", - "FutureDate", - # version - "compiled", - "VERSION", -] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/validators.py new/pydantic-2.7.4/pydantic/v1/validators.py --- old/pydantic-2.7.3/pydantic/v1/validators.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/validators.py 2024-06-12 15:44:13.000000000 +0200 @@ -28,9 +28,9 @@ ) from uuid import UUID -from . import errors -from .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time -from .typing import ( +from pydantic.v1 import errors +from pydantic.v1.datetime_parse import parse_date, parse_datetime, parse_duration, parse_time +from pydantic.v1.typing import ( AnyCallable, all_literal_values, display_as_type, @@ -41,14 +41,14 @@ is_none_type, is_typeddict, ) -from .utils import almost_equal_floats, lenient_issubclass, sequence_like +from pydantic.v1.utils import almost_equal_floats, lenient_issubclass, sequence_like if TYPE_CHECKING: from typing_extensions import Literal, TypedDict - from .config import BaseConfig - from .fields import ModelField - from .types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt + from pydantic.v1.config import BaseConfig + from pydantic.v1.fields import ModelField + from pydantic.v1.types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt ConstrainedNumber = Union[ConstrainedDecimal, ConstrainedFloat, ConstrainedInt] AnyOrderedDict = OrderedDict[Any, Any] @@ -594,7 +594,7 @@ def make_namedtuple_validator( namedtuple_cls: Type[NamedTupleT], config: Type['BaseConfig'] ) -> Callable[[Tuple[Any, ...]], NamedTupleT]: - from .annotated_types import create_model_from_namedtuple + from pydantic.v1.annotated_types import create_model_from_namedtuple NamedTupleModel = create_model_from_namedtuple( namedtuple_cls, @@ -619,7 +619,7 @@ def make_typeddict_validator( typeddict_cls: Type['TypedDict'], config: Type['BaseConfig'] # type: ignore[valid-type] ) -> Callable[[Any], Dict[str, Any]]: - from .annotated_types import create_model_from_typeddict + from pydantic.v1.annotated_types import create_model_from_typeddict TypedDictModel = create_model_from_typeddict( typeddict_cls, @@ -698,7 +698,7 @@ def find_validators( # noqa: C901 (ignore complexity) type_: Type[Any], config: Type['BaseConfig'] ) -> Generator[AnyCallable, None, None]: - from .dataclasses import is_builtin_dataclass, make_dataclass_validator + from pydantic.v1.dataclasses import is_builtin_dataclass, make_dataclass_validator if type_ is Any or type_ is object: return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/v1/version.py new/pydantic-2.7.4/pydantic/v1/version.py --- old/pydantic-2.7.3/pydantic/v1/version.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/v1/version.py 2024-06-12 15:44:13.000000000 +0200 @@ -1,6 +1,6 @@ __all__ = 'compiled', 'VERSION', 'version_info' -VERSION = '1.10.15' +VERSION = '1.10.16' try: import cython # type: ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/pydantic/version.py new/pydantic-2.7.4/pydantic/version.py --- old/pydantic-2.7.3/pydantic/version.py 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/pydantic/version.py 2024-06-12 15:44:13.000000000 +0200 @@ -3,7 +3,7 @@ __all__ = 'VERSION', 'version_info' -VERSION = '2.7.3' +VERSION = '2.7.4' """The version of Pydantic.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-2.7.3/update_v1.sh new/pydantic-2.7.4/update_v1.sh --- old/pydantic-2.7.3/update_v1.sh 2024-06-03 20:32:51.000000000 +0200 +++ new/pydantic-2.7.4/update_v1.sh 2024-06-12 15:44:13.000000000 +0200 @@ -19,6 +19,12 @@ # Copy new V1 into pydantic/v1 cp -r pydantic ../pydantic/v1 +# Update imports in pydantic/v1 to use pydantic.v1 +find "../pydantic/v1" -name "*.py" -exec sed -i '' -E 's/from pydantic(\.[a-zA-Z0-9_]*)? import/from pydantic.v1\1 import/g' {} \; + +# Remove the v1 file from v1, it's not needed in the v2 codebase +rm ../pydantic/v1/v1.py + popd # Remove V1 clone