%global srcname basico %global pypiname copasi-basico Name: python-%{pypiname} Version: 0.90 Release: 1%{?dist} Summary: Simplified Python interface to the COPASI biochemical simulator License: Artistic-2.0 URL: https://github.com/copasi/basico # GitHub tag archive rather than the PyPI sdist. The sdist ships tests/ with # none of the 60 data files they read, and omits basico/ssr/ entirely, so # %%check against it can only be an import test. Source0: %{url}/archive/refs/tags/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # Fedora's python3-COPASI carries no python3dist() tag for the PyPI name # python-copasi, so it cannot be a generated dependency (see %%prep). BuildRequires: python3-COPASI # %%check BuildRequires: python3-pytest BuildRequires: python3-libsbml %global _description %{expand: BASICO is the COPASI team's own Python interface to COPASI: one module-level call per task rather than the C++ API's object graph. It loads and writes COPASI, SBML and OMEX files, reads and edits every model entity as pandas data frames, and runs the task set COPASI implements -- time course, steady state, parameter estimation, optimisation, metabolic control analysis, linear noise approximation, Lyapunov exponents, parameter scans and profile likelihoods. It is what makes COPASI scriptable, and the closest thing in Fedora to a replacement for a modelling GUI: everything the COPASI desktop application does, from a notebook or a script, against the same engine.} %description %_description %package -n python3-%{pypiname} Summary: %{summary} # The engine. rpm cannot generate this one: Fedora's python3-COPASI carries no # python3dist() tag for the PyPI name python-copasi. It belongs here and not in # the preamble -- this spec never builds a python-copasi-basico package, so a # preamble Requires would ship on nothing. Requires: python3-COPASI # The importable module is basico, not copasi-basico. %py_provides python3-%{srcname} %description -n python3-%{pypiname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} # versioneer has no git metadata here. Its parentdir fallback reads the version # off the unpacked directory name against parentdir_prefix = "basico-", which # is why the tarball is named basico-%%{version} and unpacked with -n above. grep -q '^parentdir_prefix = basico-$' setup.cfg || { echo "versioneer parentdir_prefix changed" >&2; exit 1; } # python-copasi is Fedora's python3-COPASI, which has no dist tag; declared by # hand above. grep -q "'python-copasi', " setup.py || { echo "python-copasi dependency not found" >&2; exit 1; } sed -i "s/'python-copasi', //" setup.py # Upstream ships basico/ssr/ (the Stochastic Simulation Reproducibility API # binding) in the tree but leaves it out of packages=, so it is absent from # every released wheel and sdist and "import basico.ssr" cannot work. Its # __init__ already degrades to CopasiSSR = None when libssr is missing, which # is Fedora's case, so shipping it costs nothing and makes the module # importable. Reported upstream. test -f %{srcname}/ssr/__init__.py || { echo "basico/ssr is gone; drop this hunk" >&2; exit 1; } grep -q "packages=\['basico', 'basico.petab'\]," setup.py || { echo "packages= list changed" >&2; exit 1; } sed -i "s/packages=\['basico', 'basico.petab'\],/packages=['basico', 'basico.petab', 'basico.ssr'],/" setup.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # Upstream's suite, offline. 112 of 117 cases pass against Fedora's COPASI; # test_petab.py and test_ssr.py skip themselves (petab and libssr are not in # Fedora), on upstream's own guards rather than ours. # # Three cases reach the network and cannot run in a build root: two fetch # models from the EBI BioModels REST service, one downloads COPASI's MIRIAM # resource list from copasi.org. # # Two more encode reference numbers this COPASI does not reproduce. Fedora # ships COPASI 4.46.300; basico 0.87 was released the same day as COPASI # 4.48.309 and is tested against it. Both cases pass against 4.48.309 and # fail against 4.46.300 -- checked directly, same source tree, only the # engine swapped -- so this is the engine version, not the packaging: # test_statistic obj is not < 0.2 after a CURRENT_SOLUTION fit # test_creation_and_run parameter SD 0.5798 against an expected 0.5657 # Re-enable both when Fedora's COPASI reaches 4.48. %pytest -q tests \ --deselect tests/test_basico_io.py::TestBasicoIO::test_load_biomodel \ --deselect tests/test_basico_io.py::TestBasicoIO::test_search_biomodels \ --deselect tests/test_model_manipulation.py::TestBasicoModelManipulation::test_set_annotation \ --deselect tests/test_parameterestimation.py::TestBasicoParamterEstimationPK::test_statistic \ --deselect tests/test_profile.py::TestProfile::test_creation_and_run %files -n python3-%{pypiname} -f %{pyproject_files} %doc README.md %license LICENSE %changelog * Fri Oct 23 2026 Morgan Hough - 0.90-1 - Update to 0.90 (upstream 2026-10-23). Runtime dependency is still only python-copasi among the COPASI pieces. The two cases that need COPASI >= 4.48 stay deselected until %%check shows otherwise. * Fri Sep 25 2026 Morgan Hough - 0.87-1 - Initial package: BASICO 0.87, the COPASI team's Python interface. Net-new to Fedora; pure Python on Fedora's own COPASI bindings and nothing else. - Sourced from the GitHub tag: the PyPI sdist ships the test files without their data and drops basico/ssr/ altogether. - Ship basico.ssr, which upstream's packages= list omits, so that "import basico.ssr" works at all; it self-disables without libssr. - Five deselections, all explained in %%check: three need the network, two encode numbers from COPASI 4.48 that Fedora's 4.46.300 does not reproduce.