Use %%py3_check_import to smoke test the package

This commit is contained in:
Karolina Surma 2022-02-17 09:08:34 +01:00
parent 1bd2cd1317
commit 4f302f3dbd

View File

@ -1,16 +1,3 @@
# we have a circular (build) dependency with the (new) pytest package
# when running the testsuite
# the testsuite is currently not compatible with pytest 3, see
# https://github.com/pytest-dev/py/issues/104
%if 0%{?fedora} || 0%{?rhel} > 7
%bcond_with tests
%else
%bcond_without tests
%endif
%global pytest_version_lb 2.9.0
%global pytest_version_ub 2.10
%global srcname py %global srcname py
Name: python-%{srcname} Name: python-%{srcname}
@ -23,11 +10,6 @@ URL: http://py.readthedocs.io/
Source: %{pypi_source} Source: %{pypi_source}
BuildArch: noarch BuildArch: noarch
%if %{with tests}
# needed by the testsuite
BuildRequires: subversion
%endif # with tests
%description %description
The py lib is a Python development support library featuring the The py lib is a Python development support library featuring the
following tools and modules: following tools and modules:
@ -44,9 +26,6 @@ Summary: Library with cross-python path, ini-parsing, io, code, log facil
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm BuildRequires: python3-setuptools_scm
%if %{with tests}
BuildRequires: python3-pytest >= %{pytest_version_lb}, python3-pytest < %{pytest_version_ub}
%endif # with tests
Requires: python3-setuptools Requires: python3-setuptools
%{?python_provide:%python_provide python3-%{srcname}} %{?python_provide:%python_provide python3-%{srcname}}
Provides: bundled(python3-apipkg) = 2.0 Provides: bundled(python3-apipkg) = 2.0
@ -88,12 +67,7 @@ rm -rf %{buildroot}%{python3_sitelib}/py/_vendored_packages/*.{dist,egg}-info
%check %check
%if %{with tests} %py3_check_import %{srcname}
# disable failing Subversion checks for now
PYTHONPATH=%{buildroot}%{python3_sitelib} \
py.test-%{python3_version} -r s -k"-TestWCSvnCommandPath" testing
%endif # with tests
%files -n python3-%{srcname} %files -n python3-%{srcname}
%doc CHANGELOG.rst %doc CHANGELOG.rst
@ -106,6 +80,7 @@ py.test-%{python3_version} -r s -k"-TestWCSvnCommandPath" testing
%changelog %changelog
* Tue Feb 15 2022 Karolina Surma <ksurma@redhat.com> - 1.11.0-3 * Tue Feb 15 2022 Karolina Surma <ksurma@redhat.com> - 1.11.0-3
- Remove documentation from the package - Remove documentation from the package
- Remove testing that requires very old pytest, use %%py3_check_import instead
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2 * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild