%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 16 %global python_major python%{py_major} %global pkgname mock %global meta_package python3-%{pkgname} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: %{python_major}-%{pkgname} Version: 3.0.5 Release: 2 Summary: A Python Mocking and Patching Library for Testing License: BSD URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/m/%{pkgname}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} Requires: %{python_major}-six >= 1.13.0 %description mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. mock is now part of the Python standard library, available as `unittest.mock `_ in Python 3.3 onwards. mock provides a core `MagicMock` class removing 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 %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: python3-six >= 1.13.0 Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{pkgname}-%{version} %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE.txt %doc PKG-INFO CHANGELOG.rst README.rst %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) #Empty %changelog * Fri Mar 31 2023 Reshma V Kumar - 3.0.5-2 - Mock for python3.9 * Mon Jan 13 2020 Ashwini Chandrappa - 3.0.5-1 -Build with python3 and updated to latest version * Thu Jun 7 2013 Tristan Delhalle - 1.0.1-1 - first version for AIX V6.1 and higher