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-01-22 20:30:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pydantic (Old) and /work/SRC/openSUSE:Factory/.python-pydantic.new.16006 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pydantic" Mon Jan 22 20:30:52 2024 rev:21 rq:1140422 version:1.10.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pydantic/python-pydantic.changes 2024-01-07 21:38:59.141145544 +0100 +++ /work/SRC/openSUSE:Factory/.python-pydantic.new.16006/python-pydantic.changes 2024-01-22 20:30:53.373908384 +0100 @@ -1,0 +2,8 @@ +Mon Jan 22 09:12:28 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 1.10.14: + * Update install.md + * Fixes ci to only deploy docs on release + * Fix cached_property handling in dataclasses when copied + +------------------------------------------------------------------- Old: ---- pydantic-1.10.13.tar.gz New: ---- pydantic-1.10.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pydantic.spec ++++++ --- /var/tmp/diff_new_pack.V7Jw6O/_old 2024-01-22 20:30:54.413946410 +0100 +++ /var/tmp/diff_new_pack.V7Jw6O/_new 2024-01-22 20:30:54.413946410 +0100 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} Name: python-pydantic -Version: 1.10.13 +Version: 1.10.14 Release: 0 Summary: Data validation and settings management using python type hinting License: MIT ++++++ pydantic-1.10.13.tar.gz -> pydantic-1.10.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/.github/workflows/ci.yml new/pydantic-1.10.14/.github/workflows/ci.yml --- old/pydantic-1.10.13/.github/workflows/ci.yml 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/.github/workflows/ci.yml 2024-01-19 16:29:06.000000000 +0100 @@ -454,7 +454,7 @@ publish_docs: needs: [check] - if: "success() && (github.ref == 'refs/heads/1.10.X-fixes' || startsWith(github.ref, 'refs/tags/'))" + if: "success() && startsWith(github.ref, 'refs/tags/')" runs-on: ubuntu-latest steps: @@ -481,18 +481,14 @@ - run: make docs - - run: mike deploy -b docs-site dev-v1 --push - if: github.ref == 'refs/heads/1.10.X-fixes' - - name: check version - if: "startsWith(github.ref, 'refs/tags/')" id: check-version uses: samuelcolvin/check-python-version@v3.2 with: version_file_path: 'pydantic/version.py' - run: mike deploy -b docs-site ${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} --update-aliases --push - if: "startsWith(github.ref, 'refs/tags/') && !fromJSON(steps.check-version.outputs.IS_PRERELEASE)" + if: "!fromJSON(steps.check-version.outputs.IS_PRERELEASE)" release: needs: [check] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/HISTORY.md new/pydantic-1.10.14/HISTORY.md --- old/pydantic-1.10.13/HISTORY.md 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/HISTORY.md 2024-01-19 16:29:06.000000000 +0100 @@ -1,3 +1,10 @@ +## v1.10.14 (2024-01-19) + +* Update install.md by @dmontagu in https://github.com/pydantic/pydantic/pull/7690 +* Fixes ci to only deploy docs on release by @sydney-runkle in https://github.com/pydantic/pydantic/pull/7740 +* Ubuntu fixes for V1 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/8540 and https://github.com/pydantic/pydantic/pull/8587 +* Fix cached_property handling in dataclasses when copied by @rdbisme in https://github.com/pydantic/pydantic/pull/8407 + ## v1.10.13 (2023-09-27) * Fix: Add max length check to `pydantic.validate_email`, #7673 by @hramezani diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/docs/extra/redirects.js new/pydantic-1.10.14/docs/extra/redirects.js --- old/pydantic-1.10.13/docs/extra/redirects.js 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/docs/extra/redirects.js 2024-01-19 16:29:06.000000000 +0100 @@ -88,8 +88,16 @@ 'history': '/changelog/', } +function sanitizeURL(url) { + // escape untrusted source by creating an anchor element and letting the browser parse it + let a = document.createElement('a'); + a.href = url; + return a.href; +} + function main() { - const fragment = location.hash.substr(1) + // escape nonstandard characters to avoid XSS attacks + const fragment = location.hash.substr(1).replace(/[^a-zA-Z0-9-_]/g, '') if (fragment === '' || location.pathname !== '/') { // no fragment or not called from root return @@ -105,7 +113,7 @@ .replace(/(v\d)-(\d+-\d{4})/, '$1$2') } - window.location = new_url + window.location = sanitizeURL(new_url) } main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/docs/install.md new/pydantic-1.10.14/docs/install.md --- old/pydantic-1.10.13/docs/install.md 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/docs/install.md 2024-01-19 16:29:06.000000000 +0100 @@ -76,5 +76,5 @@ ```bash pip install git+https://github.com/pydantic/pydantic@1.10.X-fixes#egg=pydantic # or with extras -pip install git+https;://github.com/pydantic/pydantic@1.10.X-fixes#egg=pydantic[email,dotenv] +pip install git+https://github.com/pydantic/pydantic@1.10.X-fixes#egg=pydantic[email,dotenv] ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/docs/requirements.txt new/pydantic-1.10.14/docs/requirements.txt --- old/pydantic-1.10.13/docs/requirements.txt 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/docs/requirements.txt 2024-01-19 16:29:06.000000000 +0100 @@ -5,9 +5,9 @@ hypothesis==6.54.4 markdown-include==0.8.0 mdx-truly-sane-lists==1.3 -mkdocs==1.4.2 +mkdocs==1.5.3 mkdocs-exclude==1.0.2 -mkdocs-material==9.0.5 +mkdocs-material==9.5.1 pyupgrade==2.37.3 sqlalchemy orjson diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/mkdocs.yml new/pydantic-1.10.14/mkdocs.yml --- old/pydantic-1.10.13/mkdocs.yml 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/mkdocs.yml 2024-01-19 16:29:06.000000000 +0100 @@ -76,8 +76,8 @@ - pymdownx.extra - mdx_truly_sane_lists - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.tabbed: alternate_style: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/dataclasses.py new/pydantic-1.10.14/pydantic/dataclasses.py --- old/pydantic-1.10.13/pydantic/dataclasses.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/dataclasses.py 2024-01-19 16:29:06.000000000 +0100 @@ -36,6 +36,13 @@ import sys from contextlib import contextmanager from functools import wraps + +try: + from functools import cached_property +except ImportError: + # cached_property available only for python3.8+ + pass + from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Generator, Optional, Type, TypeVar, Union, overload from typing_extensions import dataclass_transform @@ -409,6 +416,17 @@ return model +if sys.version_info >= (3, 8): + + def _is_field_cached_property(obj: 'Dataclass', k: str) -> bool: + return isinstance(getattr(type(obj), k, None), cached_property) + +else: + + def _is_field_cached_property(obj: 'Dataclass', k: str) -> bool: + return False + + def _dataclass_validate_values(self: 'Dataclass') -> None: # validation errors can occur if this function is called twice on an already initialised dataclass. # for example if Extra.forbid is enabled, it would consider __pydantic_initialised__ an invalid extra property @@ -417,9 +435,13 @@ if getattr(self, '__pydantic_has_field_info_default__', False): # We need to remove `FieldInfo` values since they are not valid as input # It's ok to do that because they are obviously the default values! - input_data = {k: v for k, v in self.__dict__.items() if not isinstance(v, FieldInfo)} + input_data = { + k: v + for k, v in self.__dict__.items() + if not (isinstance(v, FieldInfo) or _is_field_cached_property(self, k)) + } else: - input_data = self.__dict__ + input_data = {k: v for k, v in self.__dict__.items() if not _is_field_cached_property(self, k)} d, _, validation_error = validate_model(self.__pydantic_model__, input_data, cls=self.__class__) if validation_error: raise validation_error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/error_wrappers.py new/pydantic-1.10.14/pydantic/error_wrappers.py --- old/pydantic-1.10.13/pydantic/error_wrappers.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/error_wrappers.py 2024-01-19 16:29:06.000000000 +0100 @@ -101,7 +101,6 @@ ) -> Generator['ErrorDict', None, None]: for error in errors: if isinstance(error, ErrorWrapper): - if loc: error_loc = loc + error.loc_tuple() else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/fields.py new/pydantic-1.10.14/pydantic/fields.py --- old/pydantic-1.10.13/pydantic/fields.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/fields.py 2024-01-19 16:29:06.000000000 +0100 @@ -178,7 +178,6 @@ self.extra = kwargs def __repr_args__(self) -> 'ReprArgs': - field_defaults_to_hide: Dict[str, Any] = { 'repr': True, **self.__field_constraints__, @@ -405,7 +404,6 @@ alias: Optional[str] = None, field_info: Optional[FieldInfo] = None, ) -> None: - self.name: str = name self.has_alias: bool = alias is not None self.alias: str = alias if alias is not None else name @@ -852,7 +850,6 @@ def validate( self, v: Any, values: Dict[str, Any], *, loc: 'LocStr', cls: Optional['ModelOrDc'] = None ) -> 'ValidateReturn': - assert self.type_.__class__ is not DeferredType if self.type_.__class__ is ForwardRef: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/main.py new/pydantic-1.10.14/pydantic/main.py --- old/pydantic-1.10.13/pydantic/main.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/main.py 2024-01-19 16:29:06.000000000 +0100 @@ -737,7 +737,6 @@ exclude_defaults: bool, exclude_none: bool, ) -> Any: - if isinstance(v, BaseModel): if to_dict: v_dict = v.dict( @@ -830,7 +829,6 @@ exclude_defaults: bool = False, exclude_none: bool = False, ) -> 'TupleGenerator': - # Merge field set excludes with explicit exclude parameter with explicit overriding field set options. # The extra "is not None" guards are not logically necessary but optimizes performance for the simple case. if exclude is not None or self.__exclude_fields__ is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/schema.py new/pydantic-1.10.14/pydantic/schema.py --- old/pydantic-1.10.13/pydantic/schema.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/schema.py 2024-01-19 16:29:06.000000000 +0100 @@ -198,7 +198,6 @@ def get_field_info_schema(field: ModelField, schema_overrides: bool = False) -> Tuple[Dict[str, Any], bool]: - # If no title is explicitly set, we don't set title in the schema for enums. # The behaviour is the same as `BaseModel` reference, where the default title # is in the definitions part of the schema. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/types.py new/pydantic-1.10.14/pydantic/types.py --- old/pydantic-1.10.13/pydantic/types.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/types.py 2024-01-19 16:29:06.000000000 +0100 @@ -481,6 +481,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # This types superclass should be Set[T], but cython chokes on that... class ConstrainedSet(set): # type: ignore # Needed for pydantic to detect that this is a set @@ -569,6 +570,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIST TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # This types superclass should be List[T], but cython chokes on that... class ConstrainedList(list): # type: ignore # Needed for pydantic to detect that this is a list @@ -1094,7 +1096,6 @@ @classmethod def validate(cls, v: StrIntFloat) -> 'ByteSize': - try: return cls(int(v)) except ValueError: @@ -1116,7 +1117,6 @@ return cls(int(float(scalar) * unit_mult)) def human_readable(self, decimal: bool = False) -> str: - if decimal: divisor = 1000 units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] @@ -1135,7 +1135,6 @@ return f'{num:0.1f}{final_unit}' def to(self, unit: str) -> float: - try: unit_div = BYTE_SIZES[unit.lower()] except KeyError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/pydantic/version.py new/pydantic-1.10.14/pydantic/version.py --- old/pydantic-1.10.13/pydantic/version.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/pydantic/version.py 2024-01-19 16:29:06.000000000 +0100 @@ -1,6 +1,6 @@ __all__ = 'compiled', 'VERSION', 'version_info' -VERSION = '1.10.13' +VERSION = '1.10.14' try: import cython # type: ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_dataclasses.py new/pydantic-1.10.14/tests/test_dataclasses.py --- old/pydantic-1.10.13/tests/test_dataclasses.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_dataclasses.py 2024-01-19 16:29:06.000000000 +0100 @@ -5,6 +5,12 @@ import sys from collections.abc import Hashable from datetime import datetime + +try: + from functools import cached_property +except ImportError: + pass + from pathlib import Path from typing import Callable, ClassVar, Dict, FrozenSet, List, Optional, Set, Union @@ -1631,3 +1637,32 @@ B = copy.deepcopy(A) assert B is not A assert B(1) == A(1) + + +@pytest.mark.skipif(sys.version_info < (3, 8), reason='cached_property was introduced in python3.8 stdlib') +def test_cached_property(): + @dataclasses.dataclass(frozen=True) + class A: + name: str + + @cached_property + def _name(self): + return 'name' + + class MyModel(BaseModel, arbitrary_types_allowed=True, frozen=True, extra=Extra.forbid): + scheduler: A + + models = { + 'AX': MyModel(scheduler=A('a')), + } + + sched = A('sched') + + models_2 = { + 'AY': models['AX'].copy(update=dict(scheduler=sched)), + } + + models = {**models, **models_2} + + models['AY'].scheduler._name + MyModel.parse_obj(models['AY'].dict()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_fastapi.sh new/pydantic-1.10.14/tests/test_fastapi.sh --- old/pydantic-1.10.13/tests/test_fastapi.sh 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_fastapi.sh 2024-01-19 16:29:06.000000000 +0100 @@ -7,6 +7,9 @@ git fetch --tags git checkout 0.99.1 +# temp fix for flask dependency issue +# see: https://stackoverflow.com/questions/77213053/importerror-cannot-import-name-url-quote-from-werkzeug-urls +pip install Werkzeug==2.2.2 pip install -r requirements.txt ./scripts/test.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_generics.py new/pydantic-1.10.14/tests/test_generics.py --- old/pydantic-1.10.13/tests/test_generics.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_generics.py 2024-01-19 16:29:06.000000000 +0100 @@ -745,7 +745,6 @@ def test_generic_model_redefined_without_cache_fail(create_module, monkeypatch): - # match identity checker otherwise we never get to the redefinition check monkeypatch.setattr('pydantic.generics.all_identical', lambda left, right: False) @@ -975,7 +974,6 @@ pass class Model(GenericModel, Generic[T, KT, VT]): - map_field: GenericMapping[KT, VT] list_field: GenericList[T] @@ -1323,7 +1321,6 @@ pass class Model(GenericModel, Generic[T]): - field: GenericList[T] model = Model[int](field=[5]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_main.py new/pydantic-1.10.14/tests/test_main.py --- old/pydantic-1.10.13/tests/test_main.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_main.py 2024-01-19 16:29:06.000000000 +0100 @@ -2186,7 +2186,6 @@ def test_class_kwargs_config_and_attr_conflict(): - with pytest.raises( TypeError, match='Specifying config in two places is ambiguous, use either Config attribute or class kwargs' ): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_rich_repr.py new/pydantic-1.10.14/tests/test_rich_repr.py --- old/pydantic-1.10.13/tests/test_rich_repr.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_rich_repr.py 2024-01-19 16:29:06.000000000 +0100 @@ -25,7 +25,6 @@ def test_rich_repr_color() -> None: - color = Color((10, 20, 30, 0.1)) rich_repr = list(color.__rich_repr__()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydantic-1.10.13/tests/test_typing.py new/pydantic-1.10.14/tests/test_typing.py --- old/pydantic-1.10.13/tests/test_typing.py 2023-09-27 18:38:55.000000000 +0200 +++ new/pydantic-1.10.14/tests/test_typing.py 2024-01-19 16:29:06.000000000 +0100 @@ -103,7 +103,6 @@ @pytest.mark.skipif(sys.version_info < (3, 10), reason='NewType class was added in python 3.10.') def test_convert_generics_unsettable_args(): class User(NewType): - __origin__ = type(list[str]) __args__ = (list['Hero'],)