%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 %if 0%{?fedora} || 0%{?rhel} > 6 # keeping python3 subpackage as stdlib mock lives in a different namespace # Some people may have not fixed their imports %global with_python3 1 %endif # Not yet in Fedora buildroot %{!?python3_pkgversion:%global python3_pkgversion 3} %global mod_name mock Name: python-mock Version: 2.0.0 Release: 11%{?dist} Summary: A Python Mocking and Patching Library for Testing License: BSD URL: http://www.voidspace.org.uk/python/%{mod_name}/ Source0: https://pypi.python.org/packages/source/m/%{mod_name}/%{mod_name}-%{version}.tar.gz Patch0: 0001-Remove-pbr-dependency.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %description Mock is a Python module that provides a core mock class. It removes the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. %package -n python%{python3_pkgversion}-mock Summary: A Python Mocking and Patching Library for Testing %{?python_provide:%python_provide python%{python3_pkgversion}-%{mod_name}} Requires: python3-six >= 1.9.0 %description -n python%{python3_pkgversion}-mock Mock is a Python module that provides a core mock class. It removes the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. %prep %setup -q -n %{mod_name}-%{version} %patch0 -p1 sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py %build %{py3_build} %install %{py3_install} %if 0%{?with_python3} %files -n python%{python3_pkgversion}-mock %license LICENSE.txt %doc docs/* %{python3_sitelib}/*.egg-info %{python3_sitelib}/%{mod_name} %endif %changelog