%global srcname pytest %global pylib_version 1.4.29 Name: python3-pytest Version: 2.9.2 Release: 5%{?dist} Summary: Simple powerful testing with Python License: MIT URL: http://pytest.org Source0: https://github.com/pytest-dev/pytest/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz # No sphinx.ext.viewcode, objname arg on EL6 Patch0: python3-pytest-sphinx0.6.patch BuildArch: noarch BuildRequires: python-sphinx # For sphinx BuildRequires: python-py BuildRequires: python-docutils BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-py >= %{pylib_version} BuildRequires: python%{python3_other_pkgversion}-devel BuildRequires: python%{python3_other_pkgversion}-setuptools BuildRequires: python%{python3_other_pkgversion}-py >= %{pylib_version} # used by the testsuite, if present: # if pexpect is present, the testsuite fails on F19 due to # http://bugs.python.org/issue17998 #BuildRequires: python%{python3_pkgversion}-pexpect BuildRequires: python%{python3_pkgversion}-mock BuildRequires: python%{python3_other_pkgversion}-mock %description py.test provides simple, yet powerful testing for Python. %package -n python%{python3_pkgversion}-pytest Summary: Simple powerful testing with Python %py_provides python%{python3_pkgversion}-pytest Requires: python%{python3_pkgversion}-setuptools Requires: python%{python3_pkgversion}-py >= %{pylib_version} %description -n python%{python3_pkgversion}-pytest py.test provides simple, yet powerful testing for Python. %package -n python%{python3_other_pkgversion}-pytest Summary: Simple powerful testing with Python %py_provides python%{python3_other_pkgversion}-pytest Requires: python%{python3_other_pkgversion}-setuptools Requires: python%{python3_other_pkgversion}-py >= %{pylib_version} %description -n python%{python3_other_pkgversion}-pytest py.test provides simple, yet powerful testing for Python. %prep %setup -q -n %{srcname}-%{version} %if 0%{?rhel} && 0%{?rhel} <= 6 %patch0 -p1 -b .sphinx0.6 sed -i -e '/include:: links.txt/d' doc/en/test/plugin/*.rst %endif %build %{py3_build} %{py3_other_build} for l in doc/* ; do make -C $l html PYTHONPATH=$(pwd) %{?el6:|| :} done %install %{py3_install} ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3 ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/pytest-3 ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/pytest-%{python3_version} rm %{buildroot}%{_bindir}/py.test %{py3_other_install} ln -snf py.test-%{python3_other_version} %{buildroot}%{_bindir}/pytest-%{python3_other_version} rm %{buildroot}%{_bindir}/py.test # remove shebangs from all scripts find %{buildroot}%{python3_sitelib} -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; find %{buildroot}%{python3_other_sitelib} -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; mkdir -p _htmldocs/html for l in doc/* ; do # remove hidden file rm -f ${l}/_build/html/.buildinfo mv ${l}/_build/html _htmldocs/html/${l##doc/} done rst2html README.rst > README.html %check PATH=%{buildroot}%{_bindir}:${PATH} \ PYTHONPATH=%{buildroot}%{python3_other_sitelib} \ %{buildroot}%{_bindir}/py.test-%{python3_other_version} -r s testing # Python 3.6 has a new exception: ModuleNotFoundError # The tests of pytest 2.9.x are not yet ready for that sed -i 's/E ImportError/E ModuleNotFoundError/' testing/acceptance_test.py testing/test_terminal.py sed -i 's/\*UNEXPECTED\*ImportError\*/*UNEXPECTED*ModuleNotFoundError*/' testing/test_doctest.py sed -i 's/\*ImportError\*/*ModuleNotFoundError*/' testing/test_terminal.py PATH=%{buildroot}%{_bindir}:${PATH} \ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{buildroot}%{_bindir}/py.test-%{python3_version} -r s testing %files -n python%{python3_pkgversion}-pytest %doc CHANGELOG.rst %doc README.html %doc _htmldocs/html %license LICENSE %{_bindir}/py.test-3 %{_bindir}/py.test-%{python3_version} %{_bindir}/pytest-3 %{_bindir}/pytest-%{python3_version} %{python3_sitelib}/* %exclude %dir %{python3_sitelib}/__pycache__ %files -n python%{python3_other_pkgversion}-pytest %doc CHANGELOG.rst %doc README.html %doc _htmldocs/html %license LICENSE %{_bindir}/py.test-%{python3_other_version} %{_bindir}/pytest-%{python3_other_version} %{python3_other_sitelib}/* %exclude %dir %{python3_other_sitelib}/__pycache__ %changelog * Tue Oct 11 2022 Maxwell G - 2.9.2-5 - Add missing %%py_provides * Sat May 18 2019 Orion Poplawski - 2.9.2-4 - Ship /usr/bin/pytest-* symlinks * Thu Mar 07 2019 Troy Dawson - 2.9.2-3 - Rebuilt to change main python from 3.4 to 3.6 - Prepare check for switch to Python 3.6 * Mon Feb 04 2019 Miro HronĨok - 2.9.2-2 - Add python36-pytest - Don't own the main __pycache__ directory * Sat Nov 3 2018 Orion Poplawski - 2.9.2-1 - Update to 2.9.2 * Wed Nov 2 2016 Orion Poplawski - 2.8.5-3 - Do as much as we can to build docs on EL6 * Wed Dec 30 2015 Orion Poplawski - 2.8.5-2 - Use github tarball for source * Wed Dec 30 2015 Orion Poplawski - 2.8.5-1 - Intiial EPEL package