## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Requires python-pymongo 4.4.0 or later, so disable for F41/F42. # F43: disable until RHBZ#2356166 is fixed in python-pymongo. %bcond bson %[ %{undefined fc43} && %{undefined fc42} && %{undefined fc41} ] %bcond cbor2 1 %bcond msgpack 1 %bcond msgspec 1 %bcond orjson 1 #global commit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #global snapdate YYYYMMDD Name: python-cattrs Version: 25.1.1%{?commit:^%{snapdate}git%{sub %{commit} 1 7}} Release: %autorelease Summary: Python library for structuring and unstructuring data # SPDX License: MIT URL: https://github.com/python-attrs/cattrs # The GitHub archive contains tests and docs, which the PyPI sdist lacks %if %{undefined commit} Source: %{url}/archive/v%{version}/cattrs-%{version}.tar.gz %global srcversion %{version} %else Source: %{url}/archive/%{commit}/cattrs-%{commit}.tar.gz %global srcversion %(echo %{version} | cut -d '^' -f 1) %endif # Because an extras metapackage is conditionalized on architecture, the base # package cannot be noarch – but the rest of the binary packages *are* noarch, # with no compiled code. %global debug_package %{nil} BuildRequires: python3-devel BuildRequires: tomcli %global msgspec_enabled 0 %if %{with msgspec} %ifnarch s390x %{ix86} %global msgspec_enabled 1 %endif %endif %global _description %{expand: cattrs is an open source Python library for structuring and unstructuring data. cattrs works best with attrs classes and the usual Python collections, but other kinds of classes are supported by manually registering converters.} %description %_description %package -n python3-cattrs Summary: %{summary} BuildArch: noarch %if %{without bson} Obsoletes: python3-cattrs+bson < 25.1.1-2 %endif # Removed for Fedora 42; we can drop the Obsoletes after Fedora 44. Obsoletes: python-cattrs-doc < 24.1.2^20241004gitae80674-6 %description -n python3-cattrs %_description # Most extras metapackages are noarch: %pyproject_extras_subpkg -n python3-cattrs -a ujson pyyaml tomlkit %if %{with bson} %pyproject_extras_subpkg -n python3-cattrs -a bson %endif %if %{with cbor2} %pyproject_extras_subpkg -n python3-cattrs -a cbor2 %endif %if %{msgspec_enabled} # python-msgspec is ExcludeArch: s390x i686; the extras metapackage is arched # because it is not present on every architecture %pyproject_extras_subpkg -n python3-cattrs msgspec %endif %if %{with msgpack} %pyproject_extras_subpkg -n python3-cattrs -a msgpack %endif %if %{with orjson} %pyproject_extras_subpkg -n python3-cattrs -a orjson %endif %prep %autosetup -n cattrs-%{?!commit:%{version}}%{?commit:%{commit}} # Don’t run benchmarks when testing tomcli set pyproject.toml lists delitem 'dependency-groups.test' \ 'pytest-benchmark\b.*' sed -r -i 's/ --benchmark[^[:blank:]"]*//g' pyproject.toml # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters tomcli set pyproject.toml lists delitem 'dependency-groups.test' \ 'coverage\b.*' # Remove bundled fonts to show they are not packaged: rm -rv docs/_static/fonts/ %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION='%{srcversion}' %{pyproject_buildrequires \ -x ujson \ %if %{with orjson} -x orjson \ %endif %if %{with msgpack} -x msgpack \ %endif -x pyyaml \ -x tomlkit \ %if %{with cbor2} -x cbor2 \ %endif %if %{with bson} -x bson \ %endif %if %{msgspec_enabled} -x msgspec \ %endif -g test} %build export SETUPTOOLS_SCM_PRETEND_VERSION='%{srcversion}' %pyproject_wheel %install %pyproject_install %pyproject_save_files -l cattrs cattr %check %if %{without bson} || %{without cbor2} # These unconditionally import bson and cbor2, so they error during test # collection ignore="${ignore-} --ignore=tests/test_preconf.py" ignore="${ignore-} --ignore=tests/preconf/test_pyyaml.py" %endif %if !%{msgspec_enabled} # These unconditionally import msgspec, so they error during test collection ignore="${ignore-} --ignore=tests/preconf/test_msgspec_cpython.py" %endif %if v"0%{?python3_version}" >= v"3.14" # https://github.com/python-attrs/cattrs/issues/626 # # With 3.14.0b2: # # FAILED tests/strategies/test_include_subclasses.py::test_structure_as_union # FAILED tests/strategies/test_include_subclasses.py::test_structuring_unstructuring_unknown_subclass # FAILED tests/strategies/test_include_subclasses.py::test_overrides[wo-union-strategy-grandchild-only] # FAILED tests/strategies/test_include_subclasses.py::test_overrides[wo-union-strategy-parent-only] # FAILED tests/strategies/test_include_subclasses.py::test_parents_with_generics[True] # FAILED tests/strategies/test_include_subclasses.py::test_overrides[wo-union-strategy-child1-only] # FAILED tests/strategies/test_include_subclasses.py::test_parents_with_generics[False] # FAILED tests/strategies/test_include_subclasses.py::test_overrides[wo-union-strategy-child2-only] # FAILED tests/test_generics.py::test_deep_copy - assert list[~T | None] == lis... # FAILED tests/test_generics.py::test_structure_nested_generics_with_cols[True-int-result0] # FAILED tests/test_generics.py::test_structure_nested_generics_with_cols[False-int-result0] # FAILED tests/test_preconf.py::test_bson # FAILED tests/test_gen_dict.py::test_type_names_with_quotes - cattrs.errors.St... # FAILED tests/test_self.py::test_self_roundtrip[True] - AssertionError: assert... # FAILED tests/test_self.py::test_self_roundtrip[False] - AssertionError: asser... # FAILED tests/test_self.py::test_self_roundtrip_dataclass[True] - AssertionErr... # FAILED tests/test_self.py::test_self_roundtrip_dataclass[False] - AssertionEr... # FAILED tests/test_self.py::test_self_roundtrip_typeddict[True] - cattrs.error... # FAILED tests/test_self.py::test_self_roundtrip_typeddict[False] - cattrs.erro... # FAILED tests/test_self.py::test_self_roundtrip_namedtuple[True] - AssertionEr... # FAILED tests/test_self.py::test_self_roundtrip_namedtuple[False] - AssertionE... # FAILED tests/test_self.py::test_subclass_roundtrip[True] - AssertionError: as... # FAILED tests/test_self.py::test_subclass_roundtrip[False] - AssertionError: a... # FAILED tests/test_self.py::test_subclass_roundtrip_dataclass[True] - Assertio... # FAILED tests/test_self.py::test_subclass_roundtrip_dataclass[False] - Asserti... # FAILED tests/test_self.py::test_nested_roundtrip[True] - AssertionError: asse... # FAILED tests/test_self.py::test_nested_roundtrip[False] - AssertionError: ass... # FAILED tests/test_structure.py::test_structuring_unsupported - AssertionError... # FAILED tests/test_preconf.py::test_bson_converter # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-grandchild-only] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-union-container] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-union-compose-child] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-parent-only] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-union-compose-parent] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-non-union-container] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-union-compose-grandchild] # ERROR tests/strategies/test_include_subclasses.py::test_circular_reference[with-subclasses] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-parent-only] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-child1-only] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-union-compose-child] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-non-union-compose-parent] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-child1-only] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-union-compose-grandchild] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-child2-only] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-non-union-compose-child] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-non-union-compose-parent] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-child2-only] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-non-union-compose-grandchild] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-non-union-compose-child] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-grandchild-only] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-union-container] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-union-compose-parent] # ERROR tests/strategies/test_include_subclasses.py::test_structuring_with_inheritance[with-subclasses-non-union-compose-grandchild] # ERROR tests/strategies/test_include_subclasses.py::test_unstructuring_with_inheritance[with-subclasses-non-union-container] k="${k-}${k+ and }not test_bson" k="${k-}${k+ and }not test_bson_converter" k="${k-}${k+ and }not test_circular_reference" k="${k-}${k+ and }not test_deep_copy" k="${k-}${k+ and }not test_include_subclasses" k="${k-}${k+ and }not test_nested_roundtrip" k="${k-}${k+ and }not test_self_roundtrip" k="${k-}${k+ and }not test_self_roundtrip_dataclass" k="${k-}${k+ and }not test_self_roundtrip_namedtuple" k="${k-}${k+ and }not test_self_roundtrip_typeddict" k="${k-}${k+ and }not test_structure_nested_generics_with_cols" k="${k-}${k+ and }not test_structuring_unsupported" k="${k-}${k+ and }not test_structuring_with_inheritance" k="${k-}${k+ and }not test_subclass_roundtrip" k="${k-}${k+ and }not test_subclass_roundtrip_dataclass" k="${k-}${k+ and }not test_type_names_with_quotes" k="${k-}${k+ and }not test_unstructuring_with_inheritance" %endif %pytest --ignore-glob='bench/*' ${ignore-} -k "${k-}" -n auto %files -n python3-cattrs -f %{pyproject_files} %doc HISTORY.md %doc README.md %changelog ## START: Generated by rpmautospec * Fri Jun 06 2025 Python Maint - 25.1.1-3 - Rebuilt for Python 3.14 * Thu Jun 05 2025 Benjamin A. Beasley - 25.1.1-2 - Drop the bson extra until pymongo is fixed for Python 3.14 * Thu Jun 05 2025 Benjamin A. Beasley - 25.1.1-1 - Update to 25.1.1 (close RHBZ#2370344) * Mon Jun 02 2025 Benjamin A. Beasley - 25.1.0-4 - Remove conditional support for building PDF documentation * Mon Jun 02 2025 Benjamin A. Beasley - 25.1.0-3 - Skip tests failing on Python 3.14 until upstream acts * Mon Jun 02 2025 Benjamin A. Beasley - 25.1.0-2 - No longer skip test_simple_roundtrip_defaults * Mon Jun 02 2025 Benjamin A. Beasley - 25.1.0-1 - Update to 25.1.0 (close RHBZ#2354879) * Thu Feb 27 2025 Benjamin A. Beasley - 24.1.2^20241004gitae80674-11 - Drop EPEL10-related conditionals - EPEL10’s python-typing-extensions is too old to merge this back * Thu Feb 27 2025 Benjamin A. Beasley - 24.1.2^20241004gitae80674-10 - Enable the bson extra starting with Fedora 43 * Thu Feb 27 2025 Benjamin A. Beasley - 24.1.2^20241004gitae80674-9 - Enable the msgpack extra in EPEL10 * Sat Jan 18 2025 Fedora Release Engineering - 24.1.2^20241004gitae80674-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Mon Jan 06 2025 Benjamin A. Beasley - 24.1.2^20241004gitae80674-6 - Drop Sphinx-generated PDF docs and obsolete `-doc` subpackage in F42+ * Mon Jan 06 2025 Miro Hrončok - 24.1.2^20241004gitae80674-4 - Avoid unneeded doc dependency on the furo theme * Fri Oct 11 2024 Benjamin A. Beasley - 24.1.2^20241004gitae80674-3 - Deconditionalize using pytest-xdist - It is now available in EPEL10. * Fri Oct 11 2024 Benjamin A. Beasley - 24.1.2^20241004gitae80674-2 - Enable the msgspec extra on Fedora F41 and later - The python-msgspec package now works with Python 3.13. * Mon Oct 07 2024 Benjamin A. Beasley - 24.1.2^20241004gitae80674-1 - Update to a post-release snapshot with better Python 3.13 support * Sun Sep 22 2024 Benjamin A. Beasley - 24.1.2-1 - Update to 24.1.2 (close RHBZ#2314095) * Tue Sep 17 2024 Benjamin A. Beasley - 24.1.1-2 - Add conditionals to prepare for EPEL10 branching * Mon Sep 16 2024 Benjamin A. Beasley - 24.1.1-1 - Update to 24.1.1 (close RHBZ#2301121, fix RHBZ#2309012) * Mon Sep 16 2024 Benjamin A. Beasley - 23.2.3-10 - Enable the cbor2 extra * Mon Sep 16 2024 Benjamin A. Beasley - 23.2.3-9 - Remove bundled fonts before building to show they are not packaged * Fri Jul 19 2024 Fedora Release Engineering - 23.2.3-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Mon Jun 10 2024 Python Maint - 23.2.3-6 - Rebuilt for Python 3.13 * Mon Jun 10 2024 Miro Hrončok - 23.2.3-5 - Drop unneeded build dependency on sphinx-autobuild * Fri Jan 26 2024 Fedora Release Engineering - 23.2.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 23.2.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Jan 02 2024 Benjamin A. Beasley - 23.2.3-2 - Assert that the .dist-info directory contains a license file - Do not package a duplicate license file * Tue Dec 12 2023 Benjamin A. Beasley - 23.2.3-1 - Update to 23.2.3 (close RHBZ#2252344, fix RHBZ#2237277) - Drop “bson” extra because python-pymongo is too old * Tue Dec 12 2023 Benjamin A. Beasley - 23.1.2-2 - Confirm License is SPDX MIT * Mon Aug 28 2023 Benjamin A. Beasley - 23.1.2-1 - Update to 23.1.2 (close RHBZ#2211212) * Fri Jul 21 2023 Fedora Release Engineering - 22.2.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Apr 13 2023 Benjamin A. Beasley - 22.2.0-13 - Depend on python-orjson now that it is available * Sat Mar 18 2023 Benjamin A. Beasley - 22.2.0-12 - Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus * Wed Mar 01 2023 Miro Hrončok - 22.2.0-11 - Explicitly BuildRequire setuptools to build the documentation * Thu Jan 26 2023 Benjamin A. Beasley - 22.2.0-10 - Build and package Sphinx documentation * Thu Jan 26 2023 Benjamin A. Beasley - 22.2.0-9 - Run the tests * Fri Jan 20 2023 Fedora Release Engineering - 22.2.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-7 - chore: check in sources * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-6 - feat: remove more more unneeded BRs * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-5 - feat: remove unneeded BRs * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-4 - chore: remove macro for consistency * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-3 - fix: explicitly mention license file * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-2 - feat: loosed poetry call * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.2.0-1 - feat: ready for re-review * Wed Dec 07 2022 Ankur Sinha (Ankur Sinha Gmail) - 22.1.0-1 - wip: requires orjson, which requires maturin * Mon Aug 19 2019 Miro Hrončok - 0.9.0-5 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 0.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek - 0.9.0-2 - Subpackage python2-cattrs has been removed See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal * Thu Sep 13 2018 Miro Hrončok - 0.9.0-1 - Update to 0.9.0 to fix Python 3.7 FTBFS (#1605625) * Fri Jul 13 2018 Fedora Release Engineering - 0.6.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Jun 19 2018 Miro Hrončok - 0.6.0-4 - Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 0.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Mon Jan 29 2018 Eric Smith 0.6.0-2 - Added missing BuildRequires for python2-enum34. * Thu Jan 11 2018 Eric Smith 0.6.0-1 - Initial version. ## END: Generated by rpmautospec