diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch | 34 | ||||
| -rw-r--r-- | python-pydantic.spec | 64 | ||||
| -rw-r--r-- | sources | 1 | 
4 files changed, 100 insertions, 0 deletions
@@ -0,0 +1 @@ +/python-pydantic-1.10.21.tar.gz diff --git a/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch b/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch new file mode 100644 index 0000000..c4a981c --- /dev/null +++ b/backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch @@ -0,0 +1,34 @@ +From 22f86ad2ae1df0e1ca33a93275a1dd69d9d50988 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 16 Mar 2024 09:57:41 +0100 +Subject: [PATCH] Fix `test_assert_raises_validation_error` with pytest-8 + (#8995) (#9024) + +--- + tests/test_validators.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_validators.py b/tests/test_validators.py +index 09311f6007..c2039a19b8 100644 +--- a/tests/test_validators.py ++++ b/tests/test_validators.py +@@ -808,16 +808,16 @@ +  +         @validator('a') +         def check_a(cls, v): +-            assert v == 'a', 'invalid a' ++            if v != 'a': ++                raise AssertionError('invalid a') +             return v +  +     Model(a='a') +  +     with pytest.raises(ValidationError) as exc_info: +         Model(a='snap') +-    injected_by_pytest = "\nassert 'snap' == 'a'\n  - a\n  + snap" +     assert exc_info.value.errors() == [ +-        {'loc': ('a',), 'msg': f'invalid a{injected_by_pytest}', 'type': 'assertion_error'} ++        {'loc': ('a',), 'msg': 'invalid a', 'type': 'assertion_error'} +     ] +  +  diff --git a/python-pydantic.spec b/python-pydantic.spec new file mode 100644 index 0000000..95e2541 --- /dev/null +++ b/python-pydantic.spec @@ -0,0 +1,64 @@ +Name:           python-pydantic +Version:        1.10.21 +Release:        1 +Summary:        Data validation using Python type hinting + +License:        MIT +URL:            https://github.com/pydantic/pydantic +Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0:         backport-Fix-test_assert_raises_validation_error-with-pytest-8.patch +BuildArch:      noarch +  +BuildRequires:  python3-devel +# For check phase +BuildRequires:  python3-mypy +BuildRequires:  python3dist(pytest) +BuildRequires:  python3dist(pytest-mock) +BuildRequires:  python3dist(hypothesis) +BuildRequires:  python%{python3_pkgversion}-pip +BuildRequires:  python%{python3_pkgversion}-wheel +BuildRequires:  python%{python3_pkgversion}-hatchling + +%description +Data validation and settings management using python type hinting. + +%package -n     python3-pydantic +Summary:        %{summary} +%{?python_provide:%python_provide python3-pydantic} +  +Requires:       python3-email-validator >= 1.0.3 +Requires:       python3-ujson >= 1.35 + +%description -n python3-pydantic +Data validation and settings management using python type hinting. + +%prep +%autosetup -n pydantic-%{version} -p1 + +%build +%pyproject_build + +# Docs are in MarkDown, and should be added when mkdocs is packaged. + +%install +%pyproject_install + +%check +pytest -Wdefault --ignore=tests/mypy/test_mypy.py + +%files -n python3-pydantic +%license LICENSE +%doc README.md +%{python3_sitelib}/pydantic +%{python3_sitelib}/pydantic*.dist-info/ + +%changelog +* Sat Jan 25 2025 Funda Wang <fundawang@yeah.net> - 1.10.21-1 +- update to 1.10.21 + +* Tue Jul 02 2024 zouzhimin <zouzhimin@kylinos.cn> - 1.10.14-1 +- Update package to version 1.10.14 +- fix CVE-2024-3772 + +* Mon Jun 26 2023 mengzhaoa <mengzhaoa@isoftstone.com> - 1.10.9-1 +- Initial package. @@ -0,0 +1 @@ +daab9f8aac80142a3b555afcf503dc02  python-pydantic-1.10.21.tar.gz  | 
