forked from pool/python-pydantic
* Prevent long (length > 4_300) strings/bytes as input to int fields, see python/cpython#95778 and CVE-2020-10735 * fix: dataclass wrapper was not always called * Use tomllib on Python 3.11 when parsing mypy configuration * Basic fix of GenericModel cache to detect order of arguments in Union models * Fix mypy plugin when using bare types like list and dict as default_factory * Add __hash__ method to pydancic.color.Color class * Refactor the whole pydantic dataclass decorator to really act like its standard lib equivalent. It hence keeps __eq__, __hash__, ... and makes comparison with its non-validated version possible. * Now that Config.extra is supported, dataclass ignores by default extra arguments (like BaseModel) * Fix PEP487 __set_name__ protocol in BaseModel for PrivateAttrs * Allow for custom parsing of environment variables via parse_env_var in Config * Fix StrictStr does not raise ValidationError when max_length is present in Field * Make SecretStr and SecretBytes hashable * Fix StrictBytes does not raise ValidationError when max_length is present in Field * Add support for bare type * Support Python 3.11, including binaries for 3.11 in PyPI * Add support for re.Pattern * Fix __post_init_post_parse__ is incorrectly passed keyword arguments when no __post_init__ is defined * Fix implicitly importing ForwardRef and Callable from pydantic.typing instead of typing and also expose MappingIntStrAny * remove Any types from the dataclass decorator so it can be used with the disallow_any_expr mypy option OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic?expand=0&rev=26
70 lines
2.3 KiB
RPMSpec
70 lines
2.3 KiB
RPMSpec
#
|
|
# spec file for package python-pydantic
|
|
#
|
|
# Copyright (c) 2022 SUSE LLC
|
|
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
|
%define skip_python2 1
|
|
Name: python-pydantic
|
|
Version: 1.10.2
|
|
Release: 0
|
|
Summary: Data validation and settings management using python type hinting
|
|
License: MIT
|
|
URL: https://github.com/samuelcolvin/pydantic
|
|
Source: https://github.com/samuelcolvin/pydantic/archive/v%{version}.tar.gz#/pydantic-%{version}.tar.gz
|
|
# PATCH-FIX-OPENSUSE Ignore DeprecationWarning until requests-toolbelt is fixed
|
|
# (Pulled in by email-validator)
|
|
Patch0: ignore-urllib3-pyopenssl-warning.patch
|
|
BuildRequires: %{python_module email-validator >= 1.0.3}
|
|
BuildRequires: %{python_module packaging}
|
|
BuildRequires: %{python_module pytest-mock}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module python-dotenv >= 0.10.4}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module typing_extensions >= 4.1.0}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-typing_extensions >= 4.1.0
|
|
Suggests: python-email-validator >= 1.0.3
|
|
Suggests: python-python-dotenv >= 0.10.4
|
|
BuildArch: noarch
|
|
%python_subpackages
|
|
|
|
%description
|
|
Data validation and settings management using Python type hinting.
|
|
|
|
%prep
|
|
%autosetup -p1 -n pydantic-%{version}
|
|
|
|
%build
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
%pytest -k 'not test_multiple_env_file'
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc README.md HISTORY.md
|
|
%{python_sitelib}/pydantic
|
|
%{python_sitelib}/pydantic-%{version}*-info
|
|
|
|
%changelog
|