77ca0cf
%if 0%{?rhel} && 0%{?rhel} <= 6
77ca0cf
%{!?__python2: %global __python2 /usr/bin/python2}
77ca0cf
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
77ca0cf
%endif
77ca0cf
48eb4ca
%if 0%{?fedora}
9c5eb1f
%global with_python3 1
9c5eb1f
%endif
9c5eb1f
f71e7ff
%global pylib_version 1.4.29
16bbfe7
9c5eb1f
Name:           pytest
fa2bfbd
Version:        2.8.6
Orion Poplawski ff2e495
Release:        1%{?dist}
9c5eb1f
Summary:        Simple powerful testing with Python
9c5eb1f
9c5eb1f
Group:          Development/Languages
9c5eb1f
License:        MIT
9c5eb1f
URL:            http://pytest.org
fa2bfbd
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
9c5eb1f
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9c5eb1f
9c5eb1f
BuildArch:      noarch
77ca0cf
BuildRequires:  python2-devel
9c5eb1f
BuildRequires:  python-setuptools
cc8ea75
Requires:       python-setuptools
16bbfe7
BuildRequires:  python-py >= %{pylib_version}
16bbfe7
Requires:       python-py >= %{pylib_version}
0560a6d
%if 0%{?rhel} > 6 || 0%{?fedora}
9c5eb1f
BuildRequires:  python-sphinx
8205b3a
%else
8205b3a
BuildRequires:  python-sphinx10
8205b3a
%endif # fedora
0b8017b
BuildRequires:  python-docutils
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
3bf32da
# used by the testsuite, if present:
3bf32da
%if 0%{?fedora}
Orion Poplawski 9ebb9bd
BuildRequires:  python-pexpect
3bf32da
BuildRequires:  python-mock
5c13630
BuildRequires:  python-twisted-core
3bf32da
%if 0%{?with_python3}
Orion Poplawski 9ebb9bd
BuildRequires:  python3-pexpect
3bf32da
BuildRequires:  python3-mock
3bf32da
%endif # with_python3
3bf32da
%endif # fedora
Orion Poplawski 13edb5c
Provides:       python2-%{name} = %{version}-%{release}
Orion Poplawski 13edb5c
%{?python_provide:%python_provide python2-%{name}}
3bf32da
3bf32da
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}
Orion Poplawski 13edb5c
%{?python_provide:%python_provide python3-%{name}}
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
77ca0cf
%setup -qc -n %{name}-%{version}
77ca0cf
77ca0cf
mv %{name}-%{version} python2
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
77ca0cf
cp -a python2 python3
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%build
77ca0cf
pushd python2
77ca0cf
%{__python2} setup.py build
9c5eb1f
0560a6d
%if 0%{?rhel} > 6 || 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
77ca0cf
popd
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
77ca0cf
pushd python3
9c5eb1f
%{__python3} setup.py build
9c5eb1f
popd
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%install
77ca0cf
pushd python2
77ca0cf
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
fb09380
ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test-2
9c5eb1f
9c5eb1f
# remove shebangs from all scripts
77ca0cf
find %{buildroot}%{python2_sitelib} -name '*.py' \
9c5eb1f
     -exec sed -i -e '1{/^#!/d}' {} \;
9c5eb1f
77ca0cf
mkdir -p _htmldocs/html
77ca0cf
for l in doc/* ; do
77ca0cf
  # remove hidden file
77ca0cf
  rm ${l}/_build/html/.buildinfo
77ca0cf
  mv ${l}/_build/html _htmldocs/html/${l##doc/}
77ca0cf
done
77ca0cf
77ca0cf
rst2html README.rst > README.html
77ca0cf
popd
77ca0cf
9c5eb1f
%if 0%{?with_python3}
77ca0cf
pushd python3
9c5eb1f
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
fb09380
ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3
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
9c5eb1f
# use 2.X per default
fb09380
ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test
9c5eb1f
9c5eb1f
9c5eb1f
%check
77ca0cf
pushd python2
71f464f
PATH=%{buildroot}%{_bindir}:${PATH} \
77ca0cf
PYTHONPATH=%{buildroot}%{python2_sitelib} \
f71e7ff
  %{buildroot}%{_bindir}/py.test-%{python2_version} -r s testing
77ca0cf
popd
77ca0cf
9c5eb1f
%if 0%{?with_python3}
77ca0cf
pushd python3
71f464f
PATH=%{buildroot}%{_bindir}:${PATH} \
9c5eb1f
PYTHONPATH=%{buildroot}%{python3_sitelib} \
f71e7ff
  %{buildroot}%{_bindir}/py.test-%{python3_version} -r s testing
9c5eb1f
popd
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%files
77ca0cf
%doc python2/CHANGELOG
77ca0cf
%doc python2/README.html
77ca0cf
%doc python2/_htmldocs/html
77ca0cf
%if 0%{?_licensedir:1}
77ca0cf
%license python2/LICENSE
77ca0cf
%else
77ca0cf
%doc python2/LICENSE
77ca0cf
%endif # licensedir
9c5eb1f
%{_bindir}/py.test
fb09380
%{_bindir}/py.test-2
f71e7ff
%{_bindir}/py.test-%{python2_version}
77ca0cf
%{python2_sitelib}/*
9c5eb1f
9c5eb1f
9c5eb1f
%if 0%{?with_python3}
9c5eb1f
%files -n python3-pytest
77ca0cf
%doc python3/CHANGELOG
77ca0cf
# HTML docs generated with Python2 for now
77ca0cf
%doc python2/README.html
77ca0cf
%doc python2/_htmldocs/html
77ca0cf
%if 0%{?_licensedir:1}
77ca0cf
%license python3/LICENSE
77ca0cf
%else
f71e7ff
%doc python3/LICENSE
77ca0cf
%endif # licensedir
fb09380
%{_bindir}/py.test-3
f71e7ff
%{_bindir}/py.test-%{python3_version}
9c5eb1f
%{python3_sitelib}/*
9c5eb1f
%endif # with_python3
9c5eb1f
9c5eb1f
9c5eb1f
%changelog
fa2bfbd
* Fri Jan 22 2016 Thomas Moschny <thomas.moschny@gmx.de> - 2.8.6-1
fa2bfbd
- Update to 2.8.6.
fa2bfbd
Orion Poplawski ff2e495
* Wed Dec 30 2015 Orion Poplawski <orion@cora.nwra.com> - 2.8.5-1
Orion Poplawski ff2e495
- Update to 2.8.5
Orion Poplawski ff2e495
Orion Poplawski 9ebb9bd
* Wed Dec 30 2015 Orion Poplawski <orion@cora.nwra.com> - 2.8.2-3
Orion Poplawski 9ebb9bd
- Re-enable pexpect in tests
Orion Poplawski 9ebb9bd
81d05d0
* Wed Nov 11 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.2-2
81d05d0
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
81d05d0
c94cbd4
* Tue Oct 20 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.8.2-1
c94cbd4
- Update to 2.8.2.
c94cbd4
Robert Kuska e037be8
* Mon Oct 12 2015 Robert Kuska <rkuska@redhat.com> - 2.7.3-2
Robert Kuska e037be8
- Rebuilt for Python3.5 rebuild
Robert Kuska e037be8
fb09380
* Thu Sep 17 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.3-1
fb09380
- Update to 2.7.3.
fb09380
- Provide additional symlinks to the pytest executables (rhbz#1249891).
fb09380
Orion Poplawski 13edb5c
* Mon Sep 14 2015 Orion Poplawski <orion@cora.nwra.com> - 2.7.2-2
Orion Poplawski 13edb5c
- Provide python2-pytest, use python_provide macro
Orion Poplawski 13edb5c
f71e7ff
* Thu Jun 25 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.2-1
f71e7ff
- Update to 2.7.2.
f71e7ff
- Small fixes.
f71e7ff
2cf870c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.1-2
2cf870c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2cf870c
68f6d02
* Sat May 23 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.1-1
68f6d02
- Update to 2.7.1.
68f6d02
77ca0cf
* Mon Apr 20 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.7.0-1
77ca0cf
- Update to 2.7.0.
77ca0cf
- Apply updated Python packaging guidelines.
77ca0cf
- Mark LICENSE with %%license.
77ca0cf
4ac7641
* Tue Dec  2 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.6.4-1
4ac7641
- Update to 2.6.4.
4ac7641
d55e5ca
* Sat Oct 11 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.6.3-1
d55e5ca
- Update to 2.6.3.
d55e5ca
ef0eb6b
* Fri Aug  8 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.6.1-1
ef0eb6b
- Update to 2.6.1.
ef0eb6b
d497904
* Fri Aug  1 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.6.0-1
d497904
- Update to 2.6.0.
d497904
f2bce57
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.2-3
f2bce57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f2bce57
5e35a10
* Fri May 09 2014 Dennis Gilmore <dennis@ausil.us> - 2.5.2-2
5e35a10
- Redbuild for python 3.4
5e35a10
48eb4ca
* Fri Apr 18 2014 Thomas Moschny <thomas.moschny@gmx.de> - 2.5.2-1
48eb4ca
- Update to 2.5.2.
48eb4ca
f742f49
* Mon Oct  7 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.4.2-2
f742f49
- Only run tests from the 'testing' subdir in %%check.
f742f49
71f464f
* Sat Oct  5 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.4.2-1
71f464f
- Update to 2.4.2.
71f464f
- Add buildroot's bindir to PATH while running the testsuite.
71f464f
d9b4aea
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.5-4
d9b4aea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
d9b4aea
ea6a47f
* Thu Jun 13 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.5-3
ea6a47f
- Disable tests using pexpect for now, fails on F19.
ea6a47f
5c13630
* Wed Jun 12 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.5-2
0560a6d
- Use python-sphinx for rhel > 6 (rhbz#973318).
5c13630
- Update BR to use python-pexpect instead of pexpect.
5c13630
6e12e2a
* Sat May 25 2013 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.5-1
6e12e2a
- Update to 2.3.5.
0b8017b
- Docutils needed now to build README.html.
3bf32da
- Add some BR optionally used by the testsuite.
6e12e2a
73bee36
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.4-2
73bee36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
73bee36
bb07fc2
* Fri Nov 23 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.4-1
bb07fc2
- Update to 2.3.4.
bb07fc2
388c87f
* Sun Oct 28 2012 Thomas Moschny <thomas.moschny@gmx.de> - 2.3.2-1
388c87f
- Update to 2.3.2.
388c87f
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.