%global srcname box %global pypiname python-box %global sdistname python_box Name: %{pypiname} Version: 7.4.1 Release: 1%{?dist} Summary: Dictionaries with attribute-style access, and file converters License: MIT URL: https://github.com/cdgriffith/Box # Note the sdist normalises to an underscore while the project name keeps the # hyphen, so Source and %%autosetup use different spellings. Source0: %{pypi_source %{sdistname}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # %%check -- box has no required dependencies, but its converters are the point # of the package and the suite exercises each one it can. BuildRequires: python3-pytest BuildRequires: python3-ruamel-yaml BuildRequires: python3-msgpack # TOML writing. Reading falls through to stdlib tomllib: box prefers the legacy # toml package, which Fedora does not carry, then tomllib on 3.11+, so nothing # is missing here. BuildRequires: python3-tomli-w %global _description %{expand: Box subclasses dict so that keys can be read as attributes -- box.a.b.c instead of d["a"]["b"]["c"] -- recursively, for arbitrarily nested data. It adds conversion to and from JSON, YAML, TOML, msgpack and CSV, default values, frozen and case-insensitive variants, and dotted-path lookup. It is packaged here for genedom, which uses it to carry the nested parameters of an assembly standard.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %py_provides python3-%{pypiname} %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{sdistname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # Upstream's suite, from the sdist, which ships test/ and test/data/ together. # Note the directory is test/ rather than tests/, and its modules import each # other as "from test.common import ...", which shadows the stdlib test package; # it resolves because pytest puts the source directory first on sys.path. # # Five TOON cases are deselected. box 7.4.1 can read and write Token-Oriented # Object Notation through the toon_format package, which it declares nowhere -- # not in dependencies and not in any of its seven extras -- and guards with its # own BoxError. toon_format is at 0.1.0, is a JSON variant aimed at LLM prompts, # and has no bearing on anything in this repository, so it is not worth adding a # package for. Everything else runs: 154 cases, including the JSON, YAML, TOML, # msgpack and CSV converters this is actually packaged for. %pytest -q test \ --deselect 'test/test_box.py::TestBox::test_toon_strings' \ --deselect 'test/test_box.py::TestBox::test_toon_files' \ --deselect 'test/test_box.py::TestBox::test_toon_from_toon_with_box_args' \ --deselect 'test/test_box_list.py::TestBoxList::test_toon_strings' \ --deselect 'test/test_box_list.py::TestBoxList::test_toon_files' %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst %changelog * Sun Sep 27 2026 Morgan Hough - 7.4.1-1 - Initial package: Box 7.4.1. Net-new to Fedora. - Last of the packages genedom needs. No required runtime dependencies; the optional converters rest on ruamel.yaml and msgpack, both in Fedora. - Named python-box after the PyPI project, with the importable module as python3-box and %%py_provides for python3-python-box. - From the PyPI sdist, which unusually for this batch ships its tests and their data. - Five TOON cases deselected: box supports that format through toon_format, which it declares in neither dependencies nor any of its extras. That package is at 0.1.0 and targets LLM prompts, so it is not worth carrying here. 154 cases pass, the converters included.