## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global forgeurl https://github.com/gatagat/lap/ %global commit 600c210d9bef793ee0fe502cbc350e676a6e083a %global _description %{expand: This package provides the 'lap' Python library, a Linear Assignment Problem solver using the Jonker-Volgenant algorithm. It is required by applications like Beets for efficient tag matching.} Name: python-lap Version: 0.5.12 Release: %autorelease Summary: Linear Assignment Problem solver for Python License: BSD-2-Clause %{forgemeta} URL: %{forgeurl} Source0: %{forgesource} BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: %{py3_dist pytest} %description %_description %package -n python3-lap Summary: $(summary) %description -n python3-lap %_description %prep %{forgesetup} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l lap # Run all tests # https://github.com/gatagat/lap/issues/62 # # “As of now we only test with a single test case. At the same time there is a # set of tests ready to be used. Putting this test set in place requires adding # pytest to the test environment and running it.” # # We choose not to install the test suite as lap.tests. We claim it is unlikely # that users will need them, and they carry extra dependencies and a large data # file. Whether this is right is debatable. We might suggest moving the tests # out of the package upstream. rm -rvf '%{buildroot}%{python3_sitearch}/lap/tests' sed -r -i '/.*\/lap\/tests(\/|$)/d' %{pyproject_files} sed -r -i '/lap\.tests(\.|$)/d' %{_pyproject_modules} %check # Do not run tests from the top-level directory to avoid importing the # “un-built” source. mkdir _empty cd _empty ln -s ../lap/tests %pyproject_check_import %pytest %files -n python3-lap -f %{pyproject_files} %changelog ## START: Generated by rpmautospec * Sat Jun 21 2025 John Doe - 0.5.12-1 - Uncommitted changes ## END: Generated by rpmautospec