%global srcname optlang Name: python-%{srcname} Version: 1.9.1 Release: 1%{?dist} Summary: Sympy-based mathematical optimization modelling language License: Apache-2.0 URL: https://github.com/opencobra/optlang # Not the sdist: PyPI's carries the tests but not their data files (model.json, # coli_core.json, the netlib problems). Source: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # %%check BuildRequires: python3-pytest BuildRequires: python3-jsonschema BuildRequires: python3-swiglpk BuildRequires: python3-sympy BuildRequires: python3-scipy BuildRequires: python3-numpy %global _description %{expand: optlang is a modelling language for linear and quadratic optimisation problems. Variables, constraints and objectives are built from sympy-style expressions and handed to a solver through one interface. GLPK (through swiglpk) is required and is the default; the SciPy interface works with SciPy's linear programming solvers. It is the solver layer under COBRApy.} %description %_description %package -n python3-%{srcname} Summary: %{summary} Recommends: python3-scipy Recommends: python3-numpy %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # The installed tests/ is code without its data directory. rm -r %{buildroot}%{python3_sitelib}/optlang/tests %pyproject_save_files -l %{srcname} %check # Upstream's suite from the source tree: the GLPK, exact-GLPK and SciPy # interfaces. The CPLEX, Gurobi, CBC and inspyred interfaces skip themselves # when their library is absent. %pytest -q src/optlang/tests %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst CHANGELOG.rst %changelog * Fri Oct 23 2026 Morgan Hough - 1.9.1-1 - Initial package: optlang 1.9.1 (Apache-2.0, LICENSE). Net-new to Fedora; pure Python on top of swiglpk and sympy. Required by COBRApy. - Source is the GitHub tag, not the sdist, whose test data files are missing: from the sdist 217 of the 361 cases fail on a missing model.json or coli_core.json. - Upstream suite on f44 with swiglpk 5.0.13 (PyPI wheel) and Fedora's sympy and scipy: 346 passed, 49 skipped (solvers not installed), 0 failed. - The installed optlang/tests is dropped; it has no data files to run on. - BuildRequires python3-jsonschema: %%check failed to import it on every chroot.