9c5eb1
%if (! 0%{?rhel}) || 0%{?rhel} > 6
9c5eb1
%global with_python3 1
9c5eb1
%endif
9c5eb1
%if 0%{?rhel} && 0%{?rhel} < 6
9c5eb1
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
9c5eb1
%endif
9c5eb1
16bbfe
%global pylib_version 1.4.8
16bbfe
9c5eb1
Name:           pytest
16bbfe
Version:        2.2.4
d1e937
Release:        3%{?dist}
9c5eb1
Summary:        Simple powerful testing with Python
9c5eb1
9c5eb1
Group:          Development/Languages
9c5eb1
License:        MIT
9c5eb1
URL:            http://pytest.org
9c5eb1
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.zip
9c5eb1
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9c5eb1
9c5eb1
BuildArch:      noarch
9c5eb1
BuildRequires:  python-devel
9c5eb1
BuildRequires:  python-setuptools
cc8ea7
Requires:       python-setuptools
16bbfe
BuildRequires:  python-py >= %{pylib_version}
16bbfe
Requires:       python-py >= %{pylib_version}
9c5eb1
BuildRequires:  python-sphinx
9c5eb1
%if 0%{?with_python3}
9c5eb1
BuildRequires:  python3-devel
9c5eb1
BuildRequires:  python3-setuptools
16bbfe
BuildRequires:  python3-py >= %{pylib_version}
9c5eb1
%endif # with_python3
9c5eb1
# pytest was separated from pylib at that point
9c5eb1
Conflicts:      python-py < 1.4.0
9c5eb1
9c5eb1
%description
9c5eb1
py.test provides simple, yet powerful testing for Python.
9c5eb1
9c5eb1
9c5eb1
%if 0%{?with_python3}
9c5eb1
%package -n python3-pytest
9c5eb1
Summary:        Simple powerful testing with Python
9c5eb1
Group:          Development/Languages
5cb33d
Requires:       python3-setuptools
16bbfe
Requires:       python3-py >= %{pylib_version}
9c5eb1
9c5eb1
9c5eb1
%description -n python3-pytest
9c5eb1
py.test provides simple, yet powerful testing for Python.
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
9c5eb1
%prep
9c5eb1
%setup -q
9c5eb1
9c5eb1
%if 0%{?with_python3}
9c5eb1
cp -a . %{py3dir}
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
9c5eb1
%build
9c5eb1
%{__python} setup.py build
9c5eb1
9c5eb1
make -C doc html PYTHONPATH=$(pwd)
9c5eb1
9c5eb1
%if 0%{?with_python3}
9c5eb1
pushd %{py3dir}
9c5eb1
%{__python3} setup.py build
9c5eb1
popd
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
9c5eb1
%install
9c5eb1
rm -rf %{buildroot}
9c5eb1
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
9c5eb1
9c5eb1
# remove shebangs from all scripts
9c5eb1
find %{buildroot}%{python_sitelib} -name '*.py' \
9c5eb1
     -exec sed -i -e '1{/^#!/d}' {} \;
9c5eb1
9c5eb1
%if 0%{?with_python3}
9c5eb1
pushd %{py3dir}
9c5eb1
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
9c5eb1
9c5eb1
# remove shebangs from all scripts
9c5eb1
find %{buildroot}%{python3_sitelib} -name '*.py' \
9c5eb1
     -exec sed -i -e '1{/^#!/d}' {} \;
9c5eb1
9c5eb1
popd
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
# remove hidden file
9c5eb1
rm doc/_build/html/.buildinfo
9c5eb1
9c5eb1
# use 2.X per default
9c5eb1
pushd %{buildroot}%{_bindir}
9c5eb1
ln -snf py.test-2.* py.test
9c5eb1
popd
9c5eb1
9c5eb1
9c5eb1
%clean
9c5eb1
rm -rf %{buildroot}
9c5eb1
9c5eb1
9c5eb1
%check
9c5eb1
PYTHONPATH=%{buildroot}%{python_sitelib} \
96521b
  %{buildroot}%{_bindir}/py.test -r s
9c5eb1
%if 0%{?with_python3}
9c5eb1
pushd %{py3dir}
9c5eb1
PYTHONPATH=%{buildroot}%{python3_sitelib} \
6c1078
  %{buildroot}%{_bindir}/py.test-3.* -r s
9c5eb1
popd
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
9c5eb1
%files
9c5eb1
%defattr(-,root,root,-)
9c5eb1
%doc CHANGELOG LICENSE README.txt
9c5eb1
%doc doc/_build/html
9c5eb1
%{_bindir}/py.test
9c5eb1
%{_bindir}/py.test-2.*
9c5eb1
%{python_sitelib}/*
9c5eb1
9c5eb1
9c5eb1
%if 0%{?with_python3}
9c5eb1
%files -n python3-pytest
9c5eb1
%defattr(-,root,root,-)
9c5eb1
%doc CHANGELOG LICENSE README.txt
9c5eb1
%doc doc/_build/html
9c5eb1
%{_bindir}/py.test-3.*
9c5eb1
%{python3_sitelib}/*
9c5eb1
%endif # with_python3
9c5eb1
9c5eb1
9c5eb1
%changelog
d1e937
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 2.2.4-3
d1e937
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
d1e937
b3fe38
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.4-2
b3fe38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b3fe38
16bbfe
* Wed Jun  6 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.4-1
16bbfe
- Update to 2.2.4.
16bbfe
f90839
* Wed Feb  8 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.3-1
f90839
- Update to 2.2.3.
f90839
ea97d0
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.1-2
ea97d0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ea97d0
281bb3
* Sat Dec 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.1-1
281bb3
- Update to 2.2.1.
281bb3
96521b
* Tue Dec 13 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.0-1
96521b
- Update to 2.2.0.
96521b
6c1078
* Wed Oct 26 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.3-1
6c1078
- Update to 2.1.3.
6c1078
6c1078
* Tue Sep 27 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.2-1
6c1078
- Update to 2.1.2.
6c1078
5cb33d
* Sat Sep  3 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-2
5cb33d
- Fix: python3 dependencies.
5cb33d
fb76f7
* Sun Aug 28 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-1
fb76f7
- Update to 2.1.1.
fb76f7
cc8ea7
* Thu Aug 11 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.0-2
cc8ea7
- Update Requires and BuildRequires tags.
cc8ea7
9c5eb1
* Tue Aug  9 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.0-1
9c5eb1
- Update to 2.1.0.
9c5eb1
9c5eb1
* Mon May 30 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.3-1
9c5eb1
- Update to 2.0.3.
9c5eb1
9c5eb1
* Thu Mar 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.2-1
9c5eb1
- Update to 2.0.2.
9c5eb1
9c5eb1
* Sun Jan 16 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.0-1
9c5eb1
- New package.