# the testsuite is curremtly not fully compatible with python3 %bcond_with tests %global pylib_version 1.5.0 %global with_help 1 Name: pytest Version: 3.6.4 Release: 2 Summary: A mature full-featured Python testing tool License: MIT URL: http://pytest.org Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch %if 0%{?with_help} BuildRequires: %{_bindir}/sphinx-build-3 python3-sphinxcontrib-trio %{_bindir}/rst2html %endif %global _description \ The pytest framework makes it easy to write small tests,\ yet scales to support complex functional testing for\ applications and libraries. %description %{_description} %package -n python2-%{name} Summary: %{summary} BuildRequires: python2-atomicwrites python2-attrs python2-devel python2-funcsigs BuildRequires: python2-hypothesis python2-more-itertools >= 4.0.0 python2-pluggy BuildRequires: python2-py >= %{pylib_version} python2-setuptools BuildRequires: python2-setuptools_scm python2-six BuildRequires: python2-decorator python2-jinja2 python2-mock python2-nose BuildRequires: python2-twisted python2-pytest-timeout Requires: python2-atomicwrites python2-attrs python2-funcsigs Requires: python2-more-itertools >= 4.0.0 python2-pluggy python2-six Requires: python2-py >= %{pylib_version} python2-setuptools %{?python_provide:%python_provide python2-%{name}} Provides: %{name} = %{version}-%{release} Obsoletes: %{name} < 2.8.7-3 %description -n python2-%{name} %{_description} %package -n python3-%{name} Summary: %{summary} BuildRequires: python3-atomicwrites python3-attrs python3-devel python3-hypothesis BuildRequires: python3-more-itertools python3-pluggy python3-py >= %{pylib_version} BuildRequires: python3-setuptools python3-setuptools_scm python3-six BuildRequires: python3-argcomplete python3-decorator python3-jinja2 BuildRequires: python3-mock python3-nose python3-twisted python3-pytest-timeout Requires: python3-atomicwrites python3-attrs python3-more-itertools Requires: python3-pluggy python3-py >= %{pylib_version} Requires: python3-setuptools python3-six %{?python_provide:%python_provide python3-%{name}} Obsoletes: platform-python-%{name} < %{version}-%{release} %description -n python3-%{name} %{_description} %if 0%{?with_help} %package_help %endif %prep %autosetup %build %py2_build %py3_build %if 0%{?with_help} for l in doc/* ; do make -C $l html PYTHONPATH=$(pwd)/src SPHINXBUILD=%{_bindir}/sphinx-build-3 done for f in README CHANGELOG CONTRIBUTING ; do rst2html ${f}.rst > ${f}.html done %endif %install %py2_install for file in pytest py.test; do mv $RPM_BUILD_ROOT%{_bindir}/${file} $RPM_BUILD_ROOT%{_bindir}/${file}-%{python2_version} ln -snf ${file}-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/${file}-2 done %py3_install for file in pytest py.test; do mv $RPM_BUILD_ROOT%{_bindir}/${file} $RPM_BUILD_ROOT%{_bindir}/${file}-%{python3_version} ln -snf ${file}-%{python3_version} $RPM_BUILD_ROOT%{_bindir}/${file}-3 done for file in pytest py.test; do ln -snf ${file}-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/${file} done %if 0%{?with_help} install -d _htmldocs/html for l in doc/* ; do rm ${l}/_build/html/.buildinfo mv ${l}/_build/html _htmldocs/html/${l##doc/} done %endif find $RPM_BUILD_ROOT{%{python2_sitelib},%{python3_sitelib}} \ -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; %check %if %{with tests} PATH=$RPM_BUILD_ROOT%{_bindir}:${PATH} \ PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitelib} \ $RPM_BUILD_ROOT%{_bindir}/pytest-%{python2_version} -r s testing \ --timeout=30 PATH=$RPM_BUILD_ROOT%{_bindir}:${PATH} \ PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} \ $RPM_BUILD_ROOT%{_bindir}/pytest-%{python3_version} -r s testing \ --timeout=30 %endif %files -n python2-%{name} %license LICENSE %{_bindir}/pytest %{_bindir}/pytest-2 %{_bindir}/pytest-%{python2_version} %{_bindir}/py.test %{_bindir}/py.test-2 %{_bindir}/py.test-%{python2_version} %{python2_sitelib}/pytest-*.egg-info/ %{python2_sitelib}/_pytest/ %{python2_sitelib}/pytest.py* %files -n python3-%{name} %license LICENSE %{_bindir}/pytest-3 %{_bindir}/pytest-%{python3_version} %{_bindir}/py.test-3 %{_bindir}/py.test-%{python3_version} %{python3_sitelib}/pytest-*.egg-info/ %{python3_sitelib}/_pytest/ %{python3_sitelib}/pytest.py %{python3_sitelib}/__pycache__/pytest.* %if 0%{?with_help} %files help %doc CHANGELOG.html README.html CONTRIBUTING.html _htmldocs/html %endif %changelog * Tue Dec 10 2019 mengxian - 3.6.4-2 - Package init