8205b3a
%if 0%{?fedora} > 12
9c5eb1f
%global with_python3 1
9c5eb1f
%endif
9c5eb1f
%if 0%{?rhel} && 0%{?rhel} < 6
9c5eb1f
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
9c5eb1f
%endif
9c5eb1f
e5fa0a8
%global pylib_version 1.4.10
16bbfe7
9c5eb1f
Name:           pytest
e5fa0a8
Version:        2.3.1
e5fa0a8
Release:        1%{?dist}
9c5eb1f
Summary:        Simple powerful testing with Python
9c5eb1f
9c5eb1f
Group:          Development/Languages
9c5eb1f
License:        MIT
9c5eb1f
URL:            http://pytest.org
9c5eb1f
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.zip
9c5eb1f
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9c5eb1f
9c5eb1f
BuildArch:      noarch
9c5eb1f
BuildRequires:  python-devel
9c5eb1f
BuildRequires:  python-setuptools
cc8ea75
Requires:       python-setuptools
16bbfe7
BuildRequires:  python-py >= %{pylib_version}
16bbfe7
Requires:       python-py >= %{pylib_version}
8205b3a
%if 0%{?fedora}
9c5eb1f
BuildRequires:  python-sphinx
8205b3a
%else
8205b3a
BuildRequires:  python-sphinx10
8205b3a
%endif # fedora
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
BuildRequires:  python3-devel
9c5eb1f
BuildRequires:  python3-setuptools
16bbfe7
BuildRequires:  python3-py >= %{pylib_version}
9c5eb1f
%endif # with_python3
9c5eb1f
# pytest was separated from pylib at that point
9c5eb1f
Conflicts:      python-py < 1.4.0
9c5eb1f
9c5eb1f
%description
9c5eb1f
py.test provides simple, yet powerful testing for Python.
9c5eb1f
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
%package -n python3-pytest
9c5eb1f
Summary:        Simple powerful testing with Python
9c5eb1f
Group:          Development/Languages
5cb33d7
Requires:       python3-setuptools
16bbfe7
Requires:       python3-py >= %{pylib_version}
9c5eb1f
9c5eb1f
9c5eb1f
%description -n python3-pytest
9c5eb1f
py.test provides simple, yet powerful testing for Python.
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%prep
9c5eb1f
%setup -q
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
cp -a . %{py3dir}
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%build
9c5eb1f
%{__python} setup.py build
9c5eb1f
8205b3a
%if 0%{?fedora}
e5fa0a8
for l in doc/* ; do
e5fa0a8
  make -C $l html PYTHONPATH=$(pwd)
e5fa0a8
done
8205b3a
%else
e5fa0a8
for l in doc/* ; do
e5fa0a8
  make -C $l html SPHINXBUILD=sphinx-1.0-build PYTHONPATH=$(pwd)
e5fa0a8
done
8205b3a
%endif # fedora
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
pushd %{py3dir}
9c5eb1f
%{__python3} setup.py build
9c5eb1f
popd
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%install
9c5eb1f
rm -rf %{buildroot}
9c5eb1f
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
9c5eb1f
9c5eb1f
# remove shebangs from all scripts
9c5eb1f
find %{buildroot}%{python_sitelib} -name '*.py' \
9c5eb1f
     -exec sed -i -e '1{/^#!/d}' {} \;
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
pushd %{py3dir}
9c5eb1f
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
9c5eb1f
9c5eb1f
# remove shebangs from all scripts
9c5eb1f
find %{buildroot}%{python3_sitelib} -name '*.py' \
9c5eb1f
     -exec sed -i -e '1{/^#!/d}' {} \;
9c5eb1f
9c5eb1f
popd
9c5eb1f
%endif # with_python3
9c5eb1f
e5fa0a8
mkdir -p _htmldocs/html
e5fa0a8
for l in doc/* ; do
e5fa0a8
  # remove hidden file
e5fa0a8
  rm ${l}/_build/html/.buildinfo
e5fa0a8
  mv ${l}/_build/html _htmldocs/html/${l##doc/}
e5fa0a8
done
9c5eb1f
9c5eb1f
# use 2.X per default
9c5eb1f
pushd %{buildroot}%{_bindir}
9c5eb1f
ln -snf py.test-2.* py.test
9c5eb1f
popd
9c5eb1f
9c5eb1f
9c5eb1f
%clean
9c5eb1f
rm -rf %{buildroot}
9c5eb1f
9c5eb1f
9c5eb1f
%check
9c5eb1f
PYTHONPATH=%{buildroot}%{python_sitelib} \
e5fa0a8
  %{buildroot}%{_bindir}/py.test -r s \
e5fa0a8
  --ignore=doc/ja
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
pushd %{py3dir}
9c5eb1f
PYTHONPATH=%{buildroot}%{python3_sitelib} \
97fd492
  %{buildroot}%{_bindir}/py.test-3.* -r s \
e5fa0a8
  --ignore=doc/ja \
e5fa0a8
  --ignore=doc/en/example/py2py3
9c5eb1f
popd
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%files
9c5eb1f
%defattr(-,root,root,-)
9c5eb1f
%doc CHANGELOG LICENSE README.txt
e5fa0a8
%doc _htmldocs/html
9c5eb1f
%{_bindir}/py.test
9c5eb1f
%{_bindir}/py.test-2.*
9c5eb1f
%{python_sitelib}/*
9c5eb1f
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
%files -n python3-pytest
9c5eb1f
%defattr(-,root,root,-)
9c5eb1f
%doc CHANGELOG LICENSE README.txt
e5fa0a8
%doc _htmldocs/html
9c5eb1f
%{_bindir}/py.test-3.*
9c5eb1f
%{python3_sitelib}/*
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%changelog
e5fa0a8
* Sun Oct 21 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.1-1
e5fa0a8
- Update to 2.3.1.
e5fa0a8
- Re-enable some tests, ignore others.
e5fa0a8
- Docs are available in English and Japanese now.
e5fa0a8
8205b3a
* Thu Oct 11 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.4-4
8205b3a
- Add conditional for sphinx on rhel.
8205b3a
- Remove rhel logic from with_python3 conditional.
8328a81
- Disable failing tests for Python3.
8205b3a
d1e937b
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 2.2.4-3
d1e937b
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
d1e937b
b3fe38d
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.4-2
b3fe38d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b3fe38d
16bbfe7
* Wed Jun  6 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.4-1
16bbfe7
- Update to 2.2.4.
16bbfe7
f908393
* Wed Feb  8 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.3-1
f908393
- Update to 2.2.3.
f908393
ea97d03
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.1-2
ea97d03
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ea97d03
281bb38
* Sat Dec 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.1-1
281bb38
- Update to 2.2.1.
281bb38
96521b9
* Tue Dec 13 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.2.0-1
96521b9
- Update to 2.2.0.
96521b9
6c10783
* Wed Oct 26 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.3-1
6c10783
- Update to 2.1.3.
6c10783
6c10783
* Tue Sep 27 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.2-1
6c10783
- Update to 2.1.2.
6c10783
5cb33d7
* Sat Sep  3 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-2
5cb33d7
- Fix: python3 dependencies.
5cb33d7
fb76f74
* Sun Aug 28 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.1-1
fb76f74
- Update to 2.1.1.
fb76f74
cc8ea75
* Thu Aug 11 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.0-2
cc8ea75
- Update Requires and BuildRequires tags.
cc8ea75
9c5eb1f
* Tue Aug  9 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.1.0-1
9c5eb1f
- Update to 2.1.0.
9c5eb1f
9c5eb1f
* Mon May 30 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.3-1
9c5eb1f
- Update to 2.0.3.
9c5eb1f
9c5eb1f
* Thu Mar 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.2-1
9c5eb1f
- Update to 2.0.2.
9c5eb1f
9c5eb1f
* Sun Jan 16 2011 Thomas Moschny <thomas.moschny@gmx.de> - 2.0.0-1
9c5eb1f
- New package.