%global srcname backports.unittest_mock Name: python-backports-unittest_mock Version: 1.2.1 Release: 2%{?dist} Summary: backport of unittest mock for python 3.2 and before License: MIT URL: https://github.com/jaraco/backports.unittest_mock Source0: https://files.pythonhosted.org/packages/source/b/%{srcname}/%{srcname}-%{version}.tar.gz # Upstream doesn't want to include license text, so we include it ourselves here. Source1: MIT BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools_scm # for tests BuildRequires: python2-mock BuildRequires: python3-devel BuildRequires: python3-setuptools_scm # for tests BuildRequires: python3-mock %description Provides a function “install()” which makes the “mock” module available as “unittest.mock” on Python 3.2 and earlier. Also advertises a pytest plugin which configures unittest.mock automatically. %package -n python2-backports-unittest_mock Summary: backport of unittest mock for python 3.2 and before %{?python_provide:%python_provide python2-backports-unittest_mock} %description -n python2-backports-unittest_mock Provides a function “install()” which makes the “mock” module available as “unittest.mock” on Python 3.2 and earlier. Also advertises a pytest plugin which configures unittest.mock automatically. %package -n python3-backports-unittest_mock Summary: backport of unittest mock for python 3.2 and before %{?python_provide:%python_provide python3-backports-unittest_mock} %description -n python3-backports-unittest_mock Provides a function “install()” which makes the “mock” module available as “unittest.mock” on Python 3.2 and earlier. Also advertises a pytest plugin which configures unittest.mock automatically. %prep %autosetup -n %{srcname}-%{version} %build %py2_build %py3_build %install # Must do the python2 install first because the scripts in /usr/bin are # overwritten with every setup.py install, and in general we want the # python3 version to be the default. %py2_install %py3_install install -p -m 0644 %{SOURCE1} MIT %check %{__python2} setup.py test %{__python3} setup.py test %files -n python2-backports-unittest_mock %license MIT %doc CHANGES.rst README.rst docs/* %{python2_sitelib}/* %files -n python3-backports-unittest_mock %license MIT %doc CHANGES.rst README.rst docs/* %{python3_sitelib}/* %changelog * Sat Feb 04 2017 Kevin Fenzi - 1.2.1-2 - Add copy of the MIT license. - Add python_provides * Sat Feb 04 2017 Kevin Fenzi - 1.2.1-1 - initial version for review