%global srcname petab %global ghname libpetab-python Name: python-%{srcname} Version: 0.9.0 Release: 1%{?dist} Summary: Parameter estimation tabular data (PEtab) format library License: MIT URL: https://github.com/PEtab-dev/libpetab-python # Not the sdist: PyPI's omits tests/ (and the lexer .interp/.tokens files). Source: %{url}/archive/v%{version}/%{ghname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # No python3dist() tag in Fedora for the PyPI name python-libsbml (see %%prep). BuildRequires: python3-libsbml # %%check. Upstream's "tests" extra also names pysb, petab_sciml and the # petabtests suite from git; none is in Fedora and the files that need them are # ignored below. python3-libCombine is the optional COMBINE-archive reader. BuildRequires: python3-pytest BuildRequires: python3-libCombine BuildRequires: python3-antimony BuildRequires: python3-scipy BuildRequires: python3-matplotlib BuildRequires: python3-seaborn %global _description %{expand: PEtab is a data format for specifying parameter estimation problems in systems biology: an SBML model, a table of measurements, of observables, of experimental conditions and of the parameters to estimate, tied together by a YAML file. libpetab-python reads, writes, lints and manipulates PEtab problems (versions 1 and 2), converts between them, simulates them with an SBML model plus a simulator, and plots measurements and simulations. It ships `petablint`, which validates a problem, and `petab_visualize`.} %description %_description %package -n python3-%{srcname} Summary: %{summary} # Runtime dependency rpm cannot generate: Fedora's python3-libsbml carries no # python3dist() tag for the PyPI name python-libsbml. It belongs here and not in # the preamble -- this spec never builds a python-petab package. Requires: python3-libsbml # Optional readers and plotting, imported lazily. Recommends: python3-matplotlib Recommends: python3-seaborn Recommends: python3-scipy Recommends: python3-libCombine %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{ghname}-%{version} # python-libsbml has no dist tag in Fedora; declared by hand above. grep -q '^ "python-libsbml>=5.17.0",$' pyproject.toml || { echo "python-libsbml dependency not found" >&2; exit 1; } sed -i '/^ "python-libsbml>=5.17.0",$/d' pyproject.toml # Upstream pins the ANTLR runtime to exactly 4.13.1 because its generated # lexer and parser (petab/v1/math/_generated) were produced by that ANTLR. # Fedora has the 4.13.2 runtime. Same minor series, and the grammar tests in # %%check pass against it, so the pin is relaxed to the series. grep -q '"antlr4-python3-runtime==4.13.1",' pyproject.toml || { echo "antlr4 pin not found" >&2; exit 1; } sed -i 's/"antlr4-python3-runtime==4.13.1",/"antlr4-python3-runtime>=4.13.1,<4.14",/' pyproject.toml %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check %{py3_test_envvars} %{python3} -c 'import petab.v1, petab.v2' # Upstream's suite, offline. Files not collected because they import modules # that are not in Fedora: test_math (petabtests, a git-only suite), test_priors # (benchmark_models_petab), test_model_pysb and v2/test_lint (pysb), v2/test_sciml # (petab_sciml). Deselected because a build root has no network: five *_remote # and auto_upgrade cases fetch from GitHub; test_simulate_experiment_to_events # needs COPASI's Python module, which is not in the build root. %pytest -q -o addopts= --import-mode=importlib tests \ --ignore=tests/v1/math/test_math.py \ --ignore=tests/v1/test_model_pysb.py \ --ignore=tests/v1/test_priors.py \ --ignore=tests/v2/test_lint.py \ --ignore=tests/v2/test_sciml.py \ --deselect tests/v1/test_petab.py::test_load_remote \ --deselect tests/v1/test_yaml.py::test_validate_remote \ --deselect tests/v2/test_conversion.py::test_petab1to2_remote \ --deselect tests/v2/test_core.py::test_load_remote \ --deselect tests/v2/test_core.py::test_auto_upgrade \ --deselect tests/v2/test_converters.py::test_simulate_experiment_to_events # The console scripts, as installed. PATH=%{buildroot}%{_bindir}:$PATH PYTHONPATH=%{buildroot}%{python3_sitelib} petablint --help >/dev/null %files -n python3-%{srcname} -f %{pyproject_files} %doc README.md CHANGELOG.md %{_bindir}/petablint %{_bindir}/petab_visualize %changelog * Fri Oct 23 2026 Morgan Hough - 0.9.0-1 - Initial package: libpetab-python 0.9.0 (MIT). Net-new to Fedora; pure Python. Prerequisite of pyPESTO's PEtab interface and of COPASI's petab importer. - Source is the GitHub tag, not the sdist, which has no tests. - Two dependency edits: python-libsbml has no dist tag in Fedora and is declared by hand; the exact pin antlr4-python3-runtime==4.13.1 becomes >=4.13.1,<4.14 (Fedora has 4.13.2; the generated math lexer and parser pass the suite on it). - Offline on f44 (loopback up): 199 pass, 3 skip, 6 deselected (five need the network, one needs COPASI's Python module); five test files not collected because pysb, petab_sciml, petabtests and benchmark_models_petab are not in Fedora.