Compare commits

...

No commits in common. 'c8' and 'c8-stream-2.7' have entirely different histories.

@ -1,8 +1,5 @@
%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
%bcond_without python3
%bcond_with tests
# Not yet in Fedora buildroot
%{!?python3_pkgversion:%global python3_pkgversion 3}
@ -11,21 +8,27 @@
Name: python-mock
Version: 2.0.0
Release: 11%{?dist}
Release: 13%{?dist}
Summary: A Python Mocking and Patching Library for Testing
License: BSD
URL: http://www.voidspace.org.uk/python/%{mod_name}/
Source0: http://pypi.python.org/packages/source/m/%{mod_name}/%{mod_name}-%{version}.tar.gz
Source0: https://pypi.python.org/packages/source/m/%{mod_name}/%{mod_name}-%{version}.tar.gz
Patch0: 0001-Remove-pbr-dependency.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-funcsigs
%if %{with python3}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if %{with tests}
# For tests
BuildRequires: python%{python3_pkgversion}-unittest2
BuildRequires: python%{python3_pkgversion}-six
%endif
%endif
%description
@ -35,6 +38,19 @@ 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 python2-mock
Summary: A Python Mocking and Patching Library for Testing
%{?python_provide:%python_provide python2-%{mod_name}}
Requires: python2-funcsigs
Requires: python2-six >= 1.9.0
%description -n python2-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
%if %{with python3}
%package -n python%{python3_pkgversion}-mock
Summary: A Python Mocking and Patching Library for Testing
%{?python_provide:%python_provide python%{python3_pkgversion}-%{mod_name}}
@ -46,6 +62,7 @@ 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.
%endif
%prep
@ -54,17 +71,34 @@ needed attributes in the normal way.
sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py
%build
%{py2_build}
%if %{with python3}
%{py3_build}
%endif
%check
%{__python3} -m unittest
%if %{with tests}
%if %{with python3}
# Few failing tests but keep output
%{__python3} setup.py test ||:
%endif
%endif
%install
%if %{with python3}
%{py3_install}
%endif
%{py2_install}
%files -n python2-mock
%license LICENSE.txt
%doc docs/*
%{python2_sitelib}/*.egg-info
%{python2_sitelib}/%{mod_name}
%if 0%{?with_python3}
%if %{with python3}
%files -n python%{python3_pkgversion}-mock
%license LICENSE.txt
%doc docs/*
@ -74,12 +108,20 @@ sed -i "s|VERSIONPLACEHOLDER|%{version}|" setup.cfg mock/mock.py
%changelog
* Wed Jul 11 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-11
- Remove the Python 2 subpackage
https://bugzilla.redhat.com/show_bug.cgi?id=1590793
- Re-enable tests
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.0.0-13
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-12
- Switch python3 coditions to bcond
* Sun Jul 15 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-11
- Enable Python 3 subpackage and disabled tests
* Fri Jul 13 2018 Lumír Balhar <lbalhar@redhat.com> - 2.0.0-10
- First version for python27 module
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-10
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 2.0.0-9
- Drop dependency on python3-funcsigs
(funcsigs functionality is in the Python 3 standard library -- inspect)
- Drop dependency on python2-unittest2

Loading…
Cancel
Save