%global srcname myokit Name: python-%{srcname} Version: 1.39.2 Release: 1%{?dist} Summary: Modelling and simulation of cardiac cellular electrophysiology # LICENSE.txt is the three-clause BSD text. The bundled Windows sundials # directory carried its own LICENSE (sundials is BSD-3-Clause too); it is # removed in %%prep, see there. License: BSD-3-Clause URL: https://myokit.org # The GitHub tag, not the PyPI sdist: the sdist's MANIFEST.in globs # myokit/tests/*.py only, so it leaves out the two C files # (ansic_event_based_pacing.c, ansic_time_series_pacing.c) that eight pacing # tests read. Source: https://github.com/myokit/myokit/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # %%check compiles and runs the C simulations Myokit generates, as users do. BuildRequires: gcc BuildRequires: sundials-devel BuildRequires: python3-pytest BuildRequires: python3-scipy BuildRequires: python3-sympy %global _description %{expand: Myokit is a toolkit for modelling and simulating cardiac cellular electrophysiology. Models, pacing protocols and simulation scripts are written in a small declarative language (.mmt) with units, and Myokit checks them, runs them with CVODES (generating and compiling C on the fly), and exports them to many formats: CellML 1.0, 1.1 and 2.0, SBML, Matlab, Python, C, C++, CUDA, Stan, DiffSL and others. It reads patch-clamp data from Axon and HEKA files, and analyses action potentials and Markov models. Simulating needs a C compiler and the sundials development files at run time, as Brian2 does, so those are Requires. The graphical editor and data viewers need PyQt6 or PySide6.} %description %_description %package -n python3-%{srcname} Summary: %{summary} # Myokit writes C source and builds it with the system compiler against # CVODES when a simulation is first run. Requires: gcc Requires: sundials-devel Recommends: python3-scipy Recommends: python3-sympy Recommends: python3-pyqt6 %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} # Prebuilt Windows sundials (sundials_cvodes.dll, sundials_nvecserial.dll, their # import libraries and headers), used only when running on Windows, see # _dynamically_add_embedded_sundials_win() in myokit/_config.py. Binaries that # are not built here must not ship; Fedora uses the system sundials-devel. test -d myokit/_bin/sundials-win-vs rm -r myokit/_bin/sundials-win-vs # 'configparser' is the Python 2 backport name; the standard library has the # module, and Fedora does not provide the PyPI distribution. grep -q "^ 'configparser',$" setup.py || { echo "configparser requirement not found" >&2; exit 1; } sed -i "/^ 'configparser',$/d" setup.py # myokit/gui/__init__.py imports matplotlib.backends.back_qtagg, which does not # exist (the module is backend_qtagg), then falls back to backend_qt5agg, which # matplotlib 3.10 no longer has: the whole GUI raises ModuleNotFoundError on # import. One-word fix; still present on upstream main. grep -q 'matplotlib\.backends\.back_qtagg as' myokit/gui/__init__.py || { echo "back_qtagg not found" >&2; exit 1; } sed -i 's/matplotlib\.backends\.back_qtagg as/matplotlib.backends.backend_qtagg as/' myokit/gui/__init__.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # Upstream's suite, run from the source tree: 1328 passed, 67 skipped (58 need # OpenCL, 9 need its double-precision extension; neither is available in a # build root), 0 failed. Simulations are compiled with gcc against Fedora's # sundials 7.6. # # test_case_pk_model in test_simulation_cvodes.py is a helper that pytest # collects because of its name; it takes arguments and errors with "fixture # 'parameters' not found". Upstream runs the suite with unittest, which does # not see it. %pytest -q myokit/tests \ --deselect myokit/tests/test_simulation_cvodes.py::test_case_pk_model %files -n python3-%{srcname} -f %{pyproject_files} %doc README.md CHANGELOG.md %{_bindir}/myokit %changelog * Fri Oct 23 2026 Morgan Hough - 1.39.2-1 - Initial package: Myokit 1.39.2 (BSD-3-Clause, read from LICENSE.txt). Net-new to Fedora. Pure Python that compiles C at run time, so noarch with gcc and sundials-devel as Requires. - Source is the GitHub tag: the PyPI sdist omits two C files eight tests need. - Removed myokit/_bin/sundials-win-vs, prebuilt Windows DLLs and import libraries bundled for Windows users. - Three %%prep edits for upstream defects: drop the 'configparser' PyPI backport requirement; fix matplotlib.backends.back_qtagg -> backend_qtagg so myokit.gui imports (verified: PyQt6 offscreen imports the IDE and both data viewers; the suite has no GUI tests); the GUI is otherwise untested. - Offline on f44, sundials 7.6.0, gcc 16: 1328 passed, 67 skipped (OpenCL), 1 deselected, 0 failed. CellML 1.0/1.1/2.0 parser and writer tests included. - Not done: the desktop entries, MIME types and syntax file under myokit/_bin/install-lin are not installed, and the OpenCL simulations are untested.