%global srcname cobra %global ghname cobrapy Name: python-%{srcname} Version: 0.32.1 Release: 1%{?dist} Summary: Constraint-based modelling of metabolic networks # LICENSE holds the GNU GPL v2 and the GNU LGPL v2 texts; the README says "released # under both the GPL and LGPL licenses version 2 or later. You may choose which # license you choose to use the software under", and setup.cfg says the same. License: GPL-2.0-or-later OR LGPL-2.0-or-later URL: https://opencobra.github.io/cobrapy # Not the sdist: PyPI's omits tests/. Source: https://github.com/opencobra/cobrapy/archive/%{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 BuildRequires: python3-pytest BuildRequires: python3-pytest-benchmark BuildRequires: python3-pytest-mock BuildRequires: python3-scipy BuildRequires: python3-optlang BuildRequires: python3-swiglpk %global _description %{expand: COBRApy is a package for constraint-based reconstruction and analysis of metabolic networks. It builds and edits genome-scale models (reactions, metabolites, genes, compartments), reads and writes SBML with the FBC and groups packages, JSON, YAML and MATLAB, and runs flux balance analysis, flux variability analysis, parsimonious FBA, gene and reaction deletion screens, sampling and medium design on any solver optlang supports; GLPK is the one packaged here.} %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-cobra package. Requires: python3-libsbml # The "array" extra: used by sampling and by some model-to-matrix conversions. Recommends: python3-scipy %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.19$' setup.cfg || { echo "python-libsbml dependency not found" >&2; exit 1; } sed -i '/^ python-libsbml ~=5.19$/d' setup.cfg # "future" is declared but nothing under src/ imports it (checked: no # "from future", "import future", "from builtins" or "past."), it is unmaintained # and no longer in Fedora. grep -q '^ future$' setup.cfg || { echo "future dependency not found" >&2; exit 1; } sed -i '/^ future$/d' setup.cfg %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # Upstream's suite, minus the one case that downloads e_coli_core from BiGG. # The benchmark fixtures are skipped (--benchmark-skip), as upstream's own tox # does by default. %pytest -q tests --benchmark-skip \ --deselect "tests/test_io/test_web/test_load.py::test_remote_load" %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst INSTALL.rst %changelog * Fri Oct 23 2026 Morgan Hough - 0.32.1-1 - Initial package: COBRApy 0.32.1. Net-new to Fedora; pure Python. Licence is the choice of GPL-2.0-or-later or LGPL-2.0-or-later, as the LICENSE file (both texts), README and setup.cfg state. - Needs three packages that are also new here: python-optlang, python-swiglpk (the only compiled one) and python-depinfo. python-libsbml is declared by hand as in the other SBML specs; "future" is dropped, unused. - Source is the GitHub tag, not the sdist, which has no tests. - Offline on f44 (loopback up) with swiglpk 5.0.13 from PyPI: 500 passed, 66 skipped (CPLEX, Gurobi, HiGHS, CBC etc. not installed), 11 xfailed, 1 failed - the BiGG download, deselected. The bundled example models (iJO1366, salmonella, textbook, mini) state no licence in their files.