Blob Blame History Raw
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%else  # 0#{?fedora} || 0#{?rhel} >= 8
%bcond_with python3
%endif # 0#{?fedora} || 0#{?rhel} >= 8

%global pypi_name testfixtures
%global global_sum Collection of helpers and mock objects for unit tests and doc tests
%global global_desc							\
TestFixtures is a collection of helpers and mock objects that are	\
useful when writing unit tests or doc tests.				\
									\
If you’re wondering why “yet another mock object library”, testing	\
is often described as an art form and as such some styles of library	\
will suit some people while others will suit other styles.  This	\
library contains common test fixtures the author found himself		\
repeating from package to package and so decided to extract them	\
into their own library and give them some tests of their own!


Name:		python-%{pypi_name}
Version:	4.14.3
Release:	3%{?dist}
Summary:	%{global_sum}

License:	MIT
URL:		https://pypi.python.org/pypi/%{pypi_name}
Source0:	https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz

BuildArch:	noarch

%description
%{global_desc}


%package doc
Summary:	Documentation-files for %{name}

%description doc
This package contains the documentation-files for %{name}.


%package -n python2-%{pypi_name}
Summary:	%{global_sum}

BuildRequires:	python2-devel
BuildRequires:	python-coveralls
BuildRequires:	python-django
BuildRequires:	python-manuel
BuildRequires:	python-mock
BuildRequires:	python-nose
BuildRequires:	python-nose-cov
BuildRequires:	python-nose_fixes
BuildRequires:	python-pkginfo
BuildRequires:	python-setuptools
BuildRequires:	python-setuptools_git
BuildRequires:	python-sphinx
BuildRequires:	python-twine
BuildRequires:	python-wheel
BuildRequires:	python-zope-component

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
%{global_desc}


%package -n python2-%{pypi_name}-tests
Summary:	Testsuite for python2-%{pypi_name}

Requires:	python2-%{pypi_name}		== %{version}-%{release}
Requires:	python-coveralls
Requires:	python-django
Requires:	python-manuel
Requires:	python-mock
Requires:	python-nose
Requires:	python-nose-cov
Requires:	python-nose_fixes
Requires:	python-pkginfo
Requires:	python-setuptools
Requires:	python-setuptools_git
Requires:	python-sphinx
Requires:	python-twine
Requires:	python-wheel
Requires:	python-zope-component

%{?python_provide:%python_provide python2-%{pypi_name}-tests}

%description -n python2-%{pypi_name}-tests
This package contains the testsuite for python2-%{pypi_name}.


%if %{with python3}
%package -n python3-%{pypi_name}
Summary:	%{global_sum}

BuildRequires:	python3-coveralls
BuildRequires:	python3-devel
BuildRequires:	python3-django
BuildRequires:	python3-manuel
BuildRequires:	python3-mock
BuildRequires:	python3-nose
BuildRequires:	python3-nose-cov
BuildRequires:	python3-nose_fixes
BuildRequires:	python3-pkginfo
BuildRequires:	python3-setuptools
BuildRequires:	python3-setuptools_git
BuildRequires:	python3-sphinx
BuildRequires:	python3-twine
BuildRequires:	python3-wheel
BuildRequires:	python3-zope-component

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
%{global_desc}


%package -n python3-%{pypi_name}-tests
Summary:	Testsuite for python3-%{pypi_name}

Requires:	python3-%{pypi_name}		== %{version}-%{release}
Requires:	python3-coveralls
Requires:	python3-django
Requires:	python3-manuel
Requires:	python3-mock
Requires:	python3-nose
Requires:	python3-nose-cov
Requires:	python3-nose_fixes
Requires:	python3-pkginfo
Requires:	python3-setuptools
Requires:	python3-setuptools_git
Requires:	python3-sphinx
Requires:	python3-twine
Requires:	python3-wheel
Requires:	python3-zope-component

%{?python_provide:%python_provide python3-%{pypi_name}-tests}

%description -n python3-%{pypi_name}-tests
This package contains the testsuite for python3-%{pypi_name}.
%endif # with python3


%prep
%autosetup -n %{pypi_name}-%{version} -p 1
%{__rm} -fr *.egg*


%build
%py2_build
%if %{with python3}
%py3_build
%endif # with python3
export PYTHONPATH="$PWD/build/lib"
%{__make} -C docs html
unset PYTHONPATH
%{_bindir}/find build/lib -type f -name '*.py?' -print -delete


%install
%py2_install
%if %{with python3}
%py3_install
%endif # with python3
%{__rm} -f docs/_build/html/{.buildinfo,objects.inv}


%check
%{_bindir}/nosetests-%{python2_version} -vv
%if %{with python3}
%{_bindir}/nosetests-%{python3_version} -vv
%endif # with python3


%files doc
%doc docs/changes.txt docs/_build/html PKG-INFO
%license LICENSE.txt


%files -n python2-%{pypi_name}
%doc PKG-INFO
%license LICENSE.txt
%exclude %{python2_sitelib}/%{pypi_name}/tests
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info


%files -n python2-%{pypi_name}-tests
%{python2_sitelib}/%{pypi_name}/tests


%if %{with python3}
%files -n python3-%{pypi_name}
%doc PKG-INFO
%license LICENSE.txt
%exclude %{python3_sitelib}/%{pypi_name}/tests
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info


%files -n python3-%{pypi_name}-tests
%{python3_sitelib}/%{pypi_name}/tests
%endif # with python3


%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.14.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.14.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon May 15 2017 Björn Esser <besser82@fedoraproject.org> - 4.14.3-1
- New upstream release (rhbz#1450930)

* Wed Apr 26 2017 Björn Esser <besser82@fedoraproject.org> - 4.13.5-1
- Initial import (rhbz#1445824)

* Wed Apr 26 2017 Björn Esser <besser82@fedoraproject.org> - 4.13.5-0.2
- Fix E: python-bytecode-wrong-magic-value

* Wed Apr 26 2017 Björn Esser <besser82@fedoraproject.org> - 4.13.5-0.1
- Initial rpm-release (rhbz#1445824)