%global pypi_name ssm-simulators %global dist_name ssm_simulators Name: python-%{pypi_name} Version: 0.14.0 Release: 4%{?dist} Summary: Simulators and training-data generators for sequential sampling models License: MIT URL: https://github.com/lnccbrown/ssm-simulators Source0: %{pypi_source %{dist_name}} # Cython 3.1.3 (Fedora 43) rejects the nogil prange body in # src/cssm/parallel_models.pyx because k and n are never declared; Cython # 3.2 (F44+) infers them. Upstream's own SEQUENTIAL variant of the same # function declares them Py_ssize_t, so this is an upstream oversight that # only a pre-3.2 Cython notices. Harmless on 3.2+. Patch0: python-ssm-simulators-cython31-declare-k-n.patch # Cython extension modules (the "cssm" package), so this build is arch specific. BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # Optional but recommended: GSL provides the validated Ziggurat RNG used by the # parallel simulators; OpenMP (libgomp, shipped with gcc) enables threading. BuildRequires: gsl-devel %global _description %{expand: SSM-Simulators (ssms) is a collection of fast simulators and training-data generators for sequential sampling models (SSMs) used in cognitive science, neuroscience, and simulation-based ("likelihood-free") Bayesian inference. It provides Cython implementations of drift-diffusion, race, leaky competing accumulator, Levy, Ornstein-Uhlenbeck and related models, plus utilities for generating large parameter-sweep datasets to train likelihood-approximation networks. It is the simulator backend used by the HSSM toolbox.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{dist_name}-%{version} # Upstream conservatively caps requires-python one minor ahead of what it # tests (<3.14 in 0.13, <3.15 in 0.14); the Cython sources build and import # fine on newer Python, so drop the upper bound whatever it is, and fail # loudly if the field ever changes shape. sed -i -E 's/(requires-python *= *"[^"]*),<3\.[0-9]+"/\1"/' pyproject.toml grep -q '^requires-python *= *">=3\.[0-9]*"' pyproject.toml # LICENSE and README ship with spurious executable bits in the sdist. chmod 0644 LICENSE README.md # NOTE: the parallel (nogil/prange) Cython modules require Cython >= 3.2 (as on # Fedora 44+/rawhide). Older Cython (3.1.x on Fedora 43) rejects them with # "Assignment of Python object not allowed without gil", so this package is # built only for Fedora 44 and newer. %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # The CLI module carries a "#!/usr/bin/env -S uv run --script" shebang but is # imported via its console entry point, not executed directly; strip it so it # is not treated as a non-executable script. sed -i '1{/^#!/d}' %{buildroot}%{python3_sitearch}/ssms/cli/generate.py # Two importable top-level packages: the pure-Python "ssms" and the compiled # "cssm" extension package. %pyproject_save_files ssms cssm %check %pyproject_check_import -t %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/generate %changelog * Tue Oct 06 2026 Morgan Hough - 0.14.0-4 - Extend the Cython 3.1.3 fix to race_models.pyx. -3 patched only parallel_models.pyx, because that is the one file the compiler named, and the build then failed on race_models.pyx (11084432) -- the same mistake, one file later. - Swept ALL 12 .pyx files with Cython 3.1.3 instead of waiting for the next build to name one. Four sites need the declaration, not one: the three parallel entry points in race_models.pyx (race_model, lca, racing_diffusion_model) plus ddm_flexbound_par2 in parallel_models.pyx. Each has a _sequential twin that already declares k and n as Py_ssize_t. - Note for next time: the per-file sweep finds the right FILES, but Cython aborts a file at its first error, so a file can still hide further sites. Here the structure made it checkable -- 3 flat_idx declarations in race_models.pyx, 3 sequential twins with the declaration, so 3 patches. - Verified both directions: patched tree compiles 12/12 under Cython 3.1.3 (what f43 has) AND 12/12 under 3.2.4 (what f44 has), so the chroots that already pass do not regress. * Tue Oct 06 2026 Morgan Hough - 0.14.0-3 - Declare k and n as Py_ssize_t in ddm_flexbound_par2's nogil prange body. f43 failed at %%generate_buildrequires with "src/cssm/parallel_models.pyx:217:12: Assignment of Python object not allowed without gil" (11082122). Cause is a Cython version floor, not an arch or a dependency: f43 ships Cython 3.1.3, f44 3.2.4, f45 3.2.8, and 3.2 infers C types for prange locals where 3.1.3 does not. Upstream's sequential variant of the same function already declares both as Py_ssize_t, so the patch matches their intent rather than inventing a type. - Verified red/green against Cython 3.1.3 specifically, in a venv, because this host has 3.2 and would have passed either way: unpatched exits non-zero with exactly the build's error, patched exits 0 and emits the C. * Mon Sep 14 2026 Morgan Hough - 0.14.0-2 - The requires-python relaxation matched only 0.13's "<3.14" literal; 0.14 says "<3.15", so f45/rawhide (3.15) failed with "requires a different Python". Strip whichever upper bound is present instead. * Sat Sep 12 2026 Morgan Hough - 0.14.0-1 - Update to 0.14.0 * Sat Jul 18 2026 Morgan Hough - 0.13.2-1 - Update to 0.13.2 * Sat Jun 27 2026 Morgan Hough - 0.12.3-1 - Initial package (HSSM simulator backend; partial HSSM dependency stack)