Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 7
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%else
%global with_python3 1
%endif

%global srcname pytest-cov

Name:           python-%{srcname}
Version:        2.4.0
Release:        2%{?dist}
Summary:        Pytest plugin for coverage reporting

License:        MIT
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://github.com/pytest-dev/%{srcname}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz


BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  pytest
BuildRequires:  python-coverage >= 3.7.1
# For tests
BuildRequires:  python-process-tests
BuildRequires:  python-virtualenv
Requires:       pytest
Requires:       python-coverage >= 3.7.1
Provides:       python2-%{srcname} = %{version}-%{release}

%description
Py.test plugin for coverage reporting with support for both centralised and
distributed testing, including subprocesses and multiprocessing for Python 2.


%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{srcname}
Summary:        Pytest plugin for coverage reporting
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-pytest
BuildRequires:  python%{python3_pkgversion}-coverage >= 3.7.1
# For tests
BuildRequires:  python%{python3_pkgversion}-process-tests
BuildRequires:  python%{python3_pkgversion}-virtualenv
Requires:       python%{python3_pkgversion}-pytest
Requires:       python%{python3_pkgversion}-coverage >= 3.7.1

%description -n python%{python3_pkgversion}-%{srcname}
Py.test plugin for coverage reporting with support for both centralised and
distributed testing, including subprocesses and multiprocessing for Python 3.
%endif # with_python3


%prep
%setup -q -n %{srcname}-%{version}
rm -rf *.egg-info


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3


%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install


%check
# Tests fail https://github.com/pytest-dev/pytest-cov/issues/90
PYTHONPATH=%{buildroot}%{python2_sitelib}:$PWD/tests py.test-%{python2_version} -vv || :

%if 0%{?with_python3}
PYTHONPATH=%{buildroot}%{python3_sitelib}:$PWD/tests py.test-%{python3_version} -vv || :
%endif # with_python3


%files
%license LICENSE
%doc AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst README.rst
%{python2_sitelib}/*

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst README.rst
%{python3_sitelib}/*
%endif # with_python3


%changelog
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 2.4.0-2
- Rebuild for Python 3.6

* Mon Oct 10 2016 Orion Poplawski <orion@cora.nwra.com> - 2.4.0-1
- Update to 2.4.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Jul 7 2016 Orion Poplawski <orion@cora.nwra.com> - 2.3.0-1
- Update to 2.3.0

* Mon May 23 2016 Orion Poplawski <orion@cora.nwra.com> - 2.2.1-1
- Ignore failing tests

* Sat Feb 13 2016 Orion Poplawski <orion@cora.nwra.com> - 2.2.1-1
- Update to 2.2.1

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Nov 06 2015 Robert Kuska <rkuska@redhat.com> - 2.2.0-2
- Rebuilt for Python3.5 rebuild
- Skip tests for a python3 rebuild as it seems to be env failure

* Mon Oct 5 2015 Orion Poplawski <orion@cora.nwra.com> - 2.2.0-1
- Update to 2.2.0

* Mon Sep 14 2015 Orion Poplawski <orion@cora.nwra.com> - 2.1.0-2
- Modernize spec
- Run tests properly, skipping xdist tests for now

* Mon Sep 14 2015 Tomas Tomecek <ttomecek@redhat.com> - 2.1.0-1
- upstream release 2.1.0

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Orion Poplawski <orion@cora.nwra.com> - 1.6-2
- Rebuild for Python 3.4

* Tue Feb 25 2014 Orion Poplawski <orion@cora.nwra.com> - 1.6-1
- Initial package