%global pypi_name dataclasses-json %global dist_name dataclasses_json Name: python-%{pypi_name} Version: 0.6.7 Release: 2%{?dist} Summary: Easily serialize Data Classes to and from JSON License: MIT URL: https://github.com/lidatong/dataclasses-json Source0: %{pypi_source %{dist_name}} # Port to marshmallow 4 and drop the upstream <4.0.0 cap. The cap was real, not # stale: mm4 renamed the missing=/default= field kwargs to load_default=/ # dump_default= (both accepted since 3.13), removed the Schema(context=...) # parameter, and dropped marshmallow.__version__. Verified functionally against # both marshmallow 3.25.0 and 4.3.0 (see %%check). Needed for F45+/rawhide, # which ship only marshmallow 4.x. Candidate for an upstream PR. Patch0: dataclasses-json-marshmallow4.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-poetry-core BuildRequires: python3-poetry-dynamic-versioning BuildRequires: python3-pip BuildRequires: python3-wheel BuildRequires: python3-marshmallow BuildRequires: python3-typing-inspect %description This library provides a simple API for encoding and decoding Data Classes to and from JSON. %package -n python3-%{pypi_name} Summary: %{summary} Requires: python3-marshmallow Requires: python3-typing-inspect %description -n python3-%{pypi_name} This library provides a simple API for encoding and decoding Data Classes to and from JSON. %prep %autosetup -p1 -n %{dist_name}-%{version} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files dataclasses_json %check %pyproject_check_import # Functional round-trip against the marshmallow the package will actually run # with — proves the .schema() path works, which the import check cannot. PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c "from dataclasses import dataclass; from typing import Optional; from importlib.metadata import version as v; from dataclasses_json import dataclass_json @dataclass_json @dataclass class P: x: int y: Optional[str] = None p = P(3, 'a') assert P.from_json(p.to_json()) == p, 'json round-trip mismatch' sch = P.schema() assert sch.load(sch.dump(p)) == p, 'marshmallow schema round-trip mismatch' print('dataclasses_json schema round-trip OK under marshmallow', v('marshmallow'))" %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Mon Aug 31 2026 Morgan Hough - 0.6.7-2 - Port to marshmallow 4 (Patch0) and drop the upstream <4.0.0 cap, which was real rather than stale: mm4 renamed the missing=/default= field kwargs to load_default=/dump_default= (accepted since 3.13), removed the Schema(context=...) parameter, and dropped marshmallow.__version__. Without this the generated Requires were unsatisfiable on F45+/rawhide, which ship only marshmallow 4.x, making python3-dataclasses-json uninstallable there and breaking python3-pygltflib and python3-fury downstream. - Add a functional round-trip %%check (to_json/from_json plus the .schema() marshmallow path) on top of the import check; the import check passes even when .schema() is broken. Verified against marshmallow 3.25.0 and 4.3.0. - Patch is a candidate for an upstream PR to lidatong/dataclasses-json. * Wed Feb 25 2026 Morgan Hough - 0.6.7-1 - Initial package for fury dependency