2018-08-15 15:08:37 +00:00
|
|
|
#
|
2021-05-02 21:13:10 +00:00
|
|
|
# spec file for package python-pytest-doctestplus-test
|
2018-08-15 15:08:37 +00:00
|
|
|
#
|
2021-05-02 21:13:10 +00:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2018-08-15 15:08:37 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-02-14 12:34:19 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2018-08-15 15:08:37 +00:00
|
|
|
|
|
|
|
|
2019-02-14 12:34:19 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2020-05-18 09:21:02 +00:00
|
|
|
%define skip_python2 1
|
2018-08-15 15:08:37 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-02-14 12:34:19 +00:00
|
|
|
Name: python-pytest-doctestplus%{psuffix}
|
2021-05-02 21:13:10 +00:00
|
|
|
Version: 0.9.0
|
2018-08-15 15:08:37 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Pytest plugin with advanced doctest features
|
2019-02-14 12:34:19 +00:00
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/astropy/pytest-doctestplus
|
2019-03-08 11:16:50 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-doctestplus/pytest-doctestplus-%{version}.tar.gz
|
2021-05-02 21:13:10 +00:00
|
|
|
BuildRequires: %{python_module setuptools_scm}
|
2018-08-15 15:08:37 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
2019-02-14 12:34:19 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2021-05-02 21:13:10 +00:00
|
|
|
Requires: python-pytest >= 4.6
|
|
|
|
Requires: python-setuptools >= 30.3.0
|
2018-08-15 15:08:37 +00:00
|
|
|
BuildArch: noarch
|
2019-02-14 12:34:19 +00:00
|
|
|
%if %{with test}
|
2021-05-02 21:13:10 +00:00
|
|
|
BuildRequires: %{python_module pip >= 19.3.1}
|
|
|
|
BuildRequires: %{python_module pytest-doctestplus = %{version}}
|
2019-02-14 12:34:19 +00:00
|
|
|
%endif
|
2018-08-15 15:08:37 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains a plugin for the pytest framework that provides
|
|
|
|
advanced doctest support and enables the testing of reStructuredText
|
|
|
|
(".rst") files.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytest-doctestplus-%{version}
|
2021-05-02 21:13:10 +00:00
|
|
|
# https://build.opensuse.org/request/show/889802
|
|
|
|
sed -i '/filterwarnings/,/\s+/ { /error/ a \ ignore:.*unclosed file.*:ResourceWarning
|
|
|
|
}' setup.cfg
|
2018-08-15 15:08:37 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
2019-02-14 12:34:19 +00:00
|
|
|
%if !%{with test}
|
2018-08-15 15:08:37 +00:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-02-14 12:34:19 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with test}
|
|
|
|
%check
|
2019-03-08 11:16:50 +00:00
|
|
|
export LANG=en_US.UTF8
|
2020-08-26 07:56:51 +00:00
|
|
|
export PY_IGNORE_IMPORTMISMATCH=1
|
2021-05-02 21:13:10 +00:00
|
|
|
# -k: inline pytest calls with -We, https://build.opensuse.org/request/show/889802
|
|
|
|
%pytest tests/ --doctest-plus --doctest-rst -k "not (test_doctestplus and warnings)"
|
2019-02-14 12:34:19 +00:00
|
|
|
%endif
|
2018-08-15 15:08:37 +00:00
|
|
|
|
2019-02-14 12:34:19 +00:00
|
|
|
%if !%{with test}
|
2018-08-15 15:08:37 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%doc CHANGES.rst README.rst
|
|
|
|
%license LICENSE.rst
|
2021-05-02 21:13:10 +00:00
|
|
|
%{python_sitelib}/pytest_doctestplus
|
|
|
|
%{python_sitelib}/pytest_doctestplus-%{version}*-info
|
2019-02-14 12:34:19 +00:00
|
|
|
%endif
|
2018-08-15 15:08:37 +00:00
|
|
|
|
|
|
|
%changelog
|