* Potentially breaking: Abstract sets are now structured into frozensets.
* Python 3.14 is now supported and part of the test matrix.
* Fix unstructuring NewTypes with the {class}BaseConverter.
* Make some Hypothesis tests more robust.
* {func}cattrs.strategies.include_subclasses now works with generic parent
classes and the tagged union strategy.
* Potentially breaking: Sequences are now structured into tuples.
* Add a use_alias parameter to cattrs.Converter.
* The union passthrough strategy now by default accepts ints for unions
that contain floats but not ints, when configured to be able to handle
both ints and floats. This more closely matches the current typing
behavior.
* Fix unstructuring of generic classes with stringified annotations.
* The default disambiguation hook factory is now only enabled for
converters with unstructure_strat=AS_DICT (the default).
* Switch to uv and just in lieu of PDM, tox and Make.
* Fixed AttributeError: no attribute '__parameters__' while structuring
attrs classes that inherit from parametrized generic aliases from
collections.abc.
* Potentially breaking: The converters raise StructureHandlerNotFoundError
more eagerly (on hook creation, instead of on hook use). This helps
surfacing problems with missing hooks sooner.
* typing.Self is now supported in attrs classes, dataclasses, TypedDicts
and the dict NamedTuple factories. See typing.Self for details.
* PEP 695 type aliases can now be used with
BaseConverter.register_structure_hook and
BaseConverter.register_unstructure_hook. Previously, they required the
use of BaseConverter.register_structure_hook_func.
* Some defaultdicts are now supported by default, and
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cattrs?expand=0&rev=15
89 lines
2.8 KiB
RPMSpec
89 lines
2.8 KiB
RPMSpec
#
|
|
# spec file for package python-cattrs
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
#
|
|
# 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/
|
|
#
|
|
|
|
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-cattrs
|
|
Version: 25.3.0
|
|
Release: 0
|
|
Summary: Composable complex class support for attrs and dataclasses
|
|
License: MIT
|
|
URL: https://github.com/python-attrs/cattrs
|
|
Source: https://files.pythonhosted.org/packages/source/c/cattrs/cattrs-%{version}.tar.gz
|
|
BuildRequires: %{python_module base >= 3.9}
|
|
BuildRequires: %{python_module hatch-vcs}
|
|
BuildRequires: %{python_module hatchling}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: python-rpm-macros
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module attrs >= 25.4}
|
|
BuildRequires: %{python_module PyYAML}
|
|
BuildRequires: %{python_module cbor2}
|
|
BuildRequires: %{python_module hypothesis}
|
|
BuildRequires: %{python_module immutables}
|
|
BuildRequires: %{python_module msgpack >= 1.0.2}
|
|
BuildRequires: %{python_module msgspec}
|
|
BuildRequires: %{python_module orjson}
|
|
BuildRequires: %{python_module pymongo}
|
|
BuildRequires: %{python_module pytest-benchmark}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module tomlkit}
|
|
BuildRequires: %{python_module typing_extensions >= 4.14}
|
|
BuildRequires: %{python_module ujson}
|
|
# /SECTION
|
|
BuildRequires: fdupes
|
|
Requires: python-attrs >= 25.4
|
|
%if %python_version_nodots < 311
|
|
Requires: python-exceptiongroup >= 1.1.1
|
|
%endif
|
|
Requires: python-typing_extensions >= 4.14
|
|
Suggests: python-cbor2
|
|
Suggests: python-ujson
|
|
Suggests: python-orjson
|
|
Suggests: python-msgpack
|
|
Suggests: python-PyYAML
|
|
Suggests: python-tomlkit
|
|
Suggests: python-cbor2
|
|
Suggests: python-pymongo
|
|
BuildArch: noarch
|
|
%python_subpackages
|
|
|
|
%description
|
|
Composable complex class support for attrs and dataclasses.
|
|
|
|
%prep
|
|
%autosetup -p1 -n cattrs-%{version}
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
%pytest
|
|
|
|
%files %{python_files}
|
|
%doc README.md HISTORY.md CONTRIBUTING.md
|
|
%license LICENSE
|
|
%{python_sitelib}/cattr
|
|
%{python_sitelib}/cattrs
|
|
%{python_sitelib}/cattrs-%{version}.dist-info
|
|
|
|
%changelog
|