- update to 1.10.13:

* Fix: Add max length check to `pydantic.validate_email`
  * Docs: Fix pip commands to install v1
  * Fixes the `maxlen` property being dropped on `deque`
    validation. Happened only if the deque item has been typed.
    Changes the `_validate_sequence_like` func, #6581 by
  * Importing create_model in tools.py through relative path
    instead of absolute path - so that it doesn't import V2 code
    when copied over to V2 branch, #6361 by @SharathHuddar
  * Add Pydantic `Json` field support to settings management,
  * Fixed literal validator errors for unhashable values
  * Fixed bug with generics receiving forward refs
  * Update install method of FastAPI for internal tests in CI,
    #6117 by @Kludex
  * Use packaging, not pkg_resources for versions.
- Skip some truculent tests.
  * Security fix: Fix date and datetime parsing so passing either 'infinity'
  * BaseSettings now uses the special env settings to define which
  * Change the precedence of aliases so child model aliases override
  * Add support for required Optional with name: Optional[AnyType] = Field(...)
  * alias precedence logic changed so aliases on a field always take

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic?expand=0&rev=38
This commit is contained in:
Dirk Mueller 2023-11-16 10:00:07 +00:00 committed by Git OBS Bridge
parent 6ef8ef7895
commit f4095052db
5 changed files with 108 additions and 11 deletions

View File

@ -0,0 +1,78 @@
From 5fd4002c62d3538efc3ff51f92850f4c0bf4ffab Mon Sep 17 00:00:00 2001
From: Maxwell G <maxwell@gtmx.me>
Date: Sat, 12 Aug 2023 00:21:50 +0000
Subject: [PATCH] Fix Python 3.12 test failures
---
tests/test_abc.py | 15 ++++++++++++---
tests/test_generics.py | 6 ++++--
tests/test_types.py | 6 +++++-
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/tests/test_abc.py b/tests/test_abc.py
index 8beed04..d7e8f3d 100644
--- a/tests/test_abc.py
+++ b/tests/test_abc.py
@@ -1,4 +1,5 @@
import abc
+import sys
import pytest
@@ -40,7 +41,15 @@ def test_model_subclassing_abstract_base_classes_without_implementation_raises_e
with pytest.raises(TypeError) as excinfo:
Model(some_field='some_value')
- assert str(excinfo.value) == (
- "Can't instantiate abstract class Model with abstract methods "
- "my_abstract_classmethod, my_abstract_method, my_abstract_property, my_abstract_staticmethod" # noqa: Q000
+ message = (
+ (
+ "Can't instantiate abstract class Model with abstract methods "
+ "my_abstract_classmethod, my_abstract_method, my_abstract_property, my_abstract_staticmethod" # noqa: Q000
+ )
+ if sys.version_info < (3, 12)
+ else (
+ "Can't instantiate abstract class Model without an implementation for abstract methods "
+ "'my_abstract_classmethod', 'my_abstract_method', 'my_abstract_property', 'my_abstract_staticmethod'" # noqa: Q000
+ )
)
+ assert str(excinfo.value) == message
diff --git a/tests/test_generics.py b/tests/test_generics.py
index 68f93d4..23e6263 100644
--- a/tests/test_generics.py
+++ b/tests/test_generics.py
@@ -579,9 +579,11 @@ def test_partial_specification_name():
b: BT
partial_model = Model[int, BT]
- assert partial_model.__name__ == 'Model[int, BT]'
+ expected = 'Model[int, BT]' if sys.version_info < (3, 12) else 'Model[int, TypeVar]'
+ assert partial_model.__name__ == expected
concrete_model = partial_model[str]
- assert concrete_model.__name__ == 'Model[int, BT][str]'
+ expected += '[str]'
+ assert concrete_model.__name__ == expected
def test_partial_specification_instantiation():
diff --git a/tests/test_types.py b/tests/test_types.py
index b908d46..4277398 100644
--- a/tests/test_types.py
+++ b/tests/test_types.py
@@ -2713,7 +2713,11 @@ def test_secretfield():
class Foobar(SecretField):
...
- message = "Can't instantiate abstract class Foobar with abstract methods? get_secret_value"
+ message = (
+ "Can't instantiate abstract class Foobar with abstract methods? get_secret_value"
+ if sys.version_info < (3, 12)
+ else "Can't instantiate abstract class Foobar without an implementation for abstract method 'get_secret_value'"
+ )
with pytest.raises(TypeError, match=message):
Foobar()
--
2.41.0

3
pydantic-1.10.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be1cbc321d34dc1dcca2525f6627a7bbdd879adfe5dbcb43c4ca6d983bd50a42
size 766572

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:147a6e94420b81d75be7ce63efc64d6cbf8e297ef27d6fc38cd4f542d955687f
size 765868

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Thu Nov 16 09:58:50 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.10.13:
* Fix: Add max length check to `pydantic.validate_email`
* Docs: Fix pip commands to install v1
* Fixes the `maxlen` property being dropped on `deque`
validation. Happened only if the deque item has been typed.
Changes the `_validate_sequence_like` func, #6581 by
* Importing create_model in tools.py through relative path
instead of absolute path - so that it doesn't import V2 code
when copied over to V2 branch, #6361 by @SharathHuddar
* Add Pydantic `Json` field support to settings management,
* Fixed literal validator errors for unhashable values
* Fixed bug with generics receiving forward refs
* Update install method of FastAPI for internal tests in CI,
#6117 by @Kludex
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 5 13:07:17 UTC 2023 - Dirk Müller <dmueller@suse.com> Wed Jul 5 13:07:17 UTC 2023 - Dirk Müller <dmueller@suse.com>
@ -168,7 +186,7 @@ Fri Sep 9 00:47:25 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
Tue Jul 19 09:20:43 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com> Tue Jul 19 09:20:43 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-pkg_resources.patch: - Add patch remove-pkg_resources.patch:
* Use packaging, not pkg_resources for versions. * Use packaging, not pkg_resources for versions.
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jun 18 13:37:28 UTC 2022 - Michael Ströder <michael@stroeder.com> Sat Jun 18 13:37:28 UTC 2022 - Michael Ströder <michael@stroeder.com>
@ -200,7 +218,7 @@ Sat Jun 18 13:37:28 UTC 2022 - Michael Ströder <michael@stroeder.com>
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Feb 2 04:12:37 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com> Wed Feb 2 04:12:37 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Skip some truculent tests. - Skip some truculent tests.
- Clean up non-required Python 3.6 {Build,}Requires. - Clean up non-required Python 3.6 {Build,}Requires.
------------------------------------------------------------------- -------------------------------------------------------------------
@ -224,7 +242,7 @@ Wed Jan 5 16:08:23 UTC 2022 - Ben Greiner <code@bnavigator.de>
Thu May 13 11:07:30 UTC 2021 - Markéta Machová <mmachova@suse.com> Thu May 13 11:07:30 UTC 2021 - Markéta Machová <mmachova@suse.com>
- Update to 1.8.2 (bsc#1186019, CVE-2021-29510) - Update to 1.8.2 (bsc#1186019, CVE-2021-29510)
* Security fix: Fix date and datetime parsing so passing either 'infinity' * Security fix: Fix date and datetime parsing so passing either 'infinity'
or float('inf') (or their negative values) does not cause an infinite loop or float('inf') (or their negative values) does not cause an infinite loop
* Allow passing json_encoders in class kwargs * Allow passing json_encoders in class kwargs
* support arbitrary types with custom __eq__ * support arbitrary types with custom __eq__
@ -385,19 +403,19 @@ Thu Mar 19 13:25:26 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
* Implement root_validator and rename root errors from __obj__ to __root__ * Implement root_validator and rename root errors from __obj__ to __root__
* Added initvars support to post_init_post_parse * Added initvars support to post_init_post_parse
* complete rewrite of URL parsing logic * complete rewrite of URL parsing logic
* BaseSettings now uses the special env settings to define which * BaseSettings now uses the special env settings to define which
environment variables to read, not aliases environment variables to read, not aliases
* add support for assert statements inside validators * add support for assert statements inside validators
* Change the precedence of aliases so child model aliases override * Change the precedence of aliases so child model aliases override
parent aliases, including using alias_generator parent aliases, including using alias_generator
* Add a mypy plugin for type checking BaseModel.__init__ and more * Add a mypy plugin for type checking BaseModel.__init__ and more
* Add support for typing.Literal for Python 3.8 * Add support for typing.Literal for Python 3.8
* Add a ByteSize type for converting byte string (1GB) to plain bytes * Add a ByteSize type for converting byte string (1GB) to plain bytes
* Add support for required Optional with name: Optional[AnyType] = Field(...) * Add support for required Optional with name: Optional[AnyType] = Field(...)
and refactor ModelField creation to preserve required parameter value and refactor ModelField creation to preserve required parameter value
* Add __eq__ to SecretStr and SecretBytes to allow "value equals" * Add __eq__ to SecretStr and SecretBytes to allow "value equals"
* Add support for nested generic models * Add support for nested generic models
* alias precedence logic changed so aliases on a field always take * alias precedence logic changed so aliases on a field always take
priority over an alias from alias_generator priority over an alias from alias_generator
* many more fixes and improvements * many more fixes and improvements

View File

@ -19,7 +19,7 @@
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-pydantic Name: python-pydantic
Version: 1.10.9 Version: 1.10.13
Release: 0 Release: 0
Summary: Data validation and settings management using python type hinting Summary: Data validation and settings management using python type hinting
License: MIT License: MIT
@ -28,6 +28,7 @@ Source: https://github.com/pydantic/pydantic/archive/v%{version}.tar.gz#
# PATCH-FIX-OPENSUSE Ignore DeprecationWarning until requests-toolbelt is fixed # PATCH-FIX-OPENSUSE Ignore DeprecationWarning until requests-toolbelt is fixed
# (Pulled in by email-validator) # (Pulled in by email-validator)
Patch0: ignore-urllib3-pyopenssl-warning.patch Patch0: ignore-urllib3-pyopenssl-warning.patch
Patch1: Fix-Python-3.12-test-failures.patch
BuildRequires: %{python_module email-validator >= 1.0.3} BuildRequires: %{python_module email-validator >= 1.0.3}
BuildRequires: %{python_module packaging} BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest-mock}