%global pypi_name phamt Name: python-%{pypi_name} Version: 0.1.8 Release: 1%{?dist} Summary: Persistent hash array mapped tries for CPython, in C License: MIT URL: https://github.com/noahbenson/phamt Source0: %{pypi_source %{pypi_name}} # The iterator's traverse/clear slots declare PHAMT_t** for the address of a # PHAMT_t (already a pointer type). Same address, wrong type: GCC 14 and later # reject it as -Wincompatible-pointer-types. Patch0: python-phamt-iter-pointer-type.patch BuildRequires: gcc BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %global _description %{expand: phamt is a C extension implementing a persistent (immutable) hash array mapped trie keyed by integers, with a pure-Python fallback. It is the storage layer of the pcollections persistent-collections library and, through it, of immlib and pyAFQ.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} # Build with Fedora's optimisation flags rather than upstream's -O3. sed -i 's/"unix": \["-std=c11", "-O3"\]/"unix": ["-std=c11"]/' setup.py grep -q '"unix": \["-std=c11"\]' setup.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pyproject_check_import # Upstream's unittest suite (phamt.test), against the C core. Run outside the # source tree, whose phamt/ has no compiled c_core and would shadow the build. cd %{_builddir} %{py3_test_envvars} %{python3} -m unittest -v phamt.test %{py3_test_envvars} %{python3} -c 'import phamt, phamt.c_core; assert phamt.PHAMT is phamt.c_core.PHAMT, "C core not used"' %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Fri Oct 16 2026 Morgan Hough - 0.1.8-1 - Initial package (pyAFQ dependency chain: pcollections, immlib). - Fix the iterator's pointer types, an error under GCC 14+.