# Copyright (C) 2023 Maxwell G # Copyright (C) Fedora Project Authors # SPDX-License-Identifier: MIT # License text: https://spdx.org/licenses/MIT %bcond tests 1 Name: bindep Version: 2.11.0 Release: 1%{?dist} Summary: Binary dependency utility License: Apache-2.0 URL: https://docs.opendev.org/opendev/bindep Source: %{pypi_source bindep} BuildArch: noarch BuildRequires: python3-devel %if %{with tests} BuildRequires: %{py3_dist pytest} %endif %description Bindep is a tool for checking the presence of binary packages needed to use an application / library. %prep %autosetup -p1 # Remove dependencies unwanted in Fedora sed -i -E '/(coverage|pytest-cov|mock)/d' test-requirements.txt find -type f -name '*.py' | xargs -d'\n' sed -i \ -e 's/^\( *\)import mock/\1from unittest import mock/' \ -e 's/^\( *\)from mock import /\1from unittest.mock import /' %generate_buildrequires %pyproject_buildrequires %{?with_tests:test-requirements.txt} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files bindep %check %if %{with tests} %pytest \ -s \ -k 'not test_arch_implies_pacman and not test_manjaro_implies_pacman' %endif %files -f %{pyproject_files} # Note(gotmax23): Yes, pyproject_save_files and setuptools already handle # this automatically, but I don't rely on it, as it makes it too easy to # miss licenses when upstream changes their build system or something else. %license LICENSE %doc README.rst doc/source/*.rst %{_bindir}/bindep %changelog * Tue Aug 15 2023 Maxwell G - 2.11.0-1 - Initial package.