2018-08-14 20:33:04 +00:00
|
|
|
#
|
2022-11-08 07:23:15 +00:00
|
|
|
# spec file
|
2018-08-14 20:33:04 +00:00
|
|
|
#
|
2023-12-14 21:33:39 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-08-14 20:33:04 +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-13 13:27:45 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2018-08-14 20:33:04 +00:00
|
|
|
|
|
|
|
|
2019-02-13 13:27:45 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2021-04-27 11:17:51 +00:00
|
|
|
|
2019-02-13 13:27:45 +00:00
|
|
|
Name: python-pytest-arraydiff%{psuffix}
|
2023-12-14 21:33:39 +00:00
|
|
|
Version: 0.6.1
|
2018-08-14 20:33:04 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Pytest plugin to help with comparing array output from tests
|
2019-02-13 13:27:45 +00:00
|
|
|
License: BSD-2-Clause
|
2021-04-27 11:17:51 +00:00
|
|
|
URL: https://github.com/astropy/pytest-arraydiff
|
2018-08-14 20:33:04 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-arraydiff/pytest-arraydiff-%{version}.tar.gz
|
2022-11-08 07:23:15 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module setuptools_scm}
|
2018-08-14 20:33:04 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2022-11-08 07:23:15 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2018-08-14 20:33:04 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-numpy
|
2022-11-08 07:23:15 +00:00
|
|
|
Requires: python-pytest >= 4.6
|
2018-08-14 20:33:04 +00:00
|
|
|
BuildArch: noarch
|
2019-02-13 13:27:45 +00:00
|
|
|
%if %{with test}
|
2022-11-08 07:23:15 +00:00
|
|
|
BuildRequires: %{python_module astropy}
|
2019-02-13 13:27:45 +00:00
|
|
|
BuildRequires: %{python_module numpy}
|
2022-11-08 07:23:15 +00:00
|
|
|
BuildRequires: %{python_module pytest >= 4.6}
|
2019-02-13 13:27:45 +00:00
|
|
|
%endif
|
2018-08-14 20:33:04 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
This is a py.test plugin to facilitate the generation and comparison of
|
|
|
|
data arrays produced during tests.
|
|
|
|
|
|
|
|
The basic idea is that you can write a test that generates a Numpy array (or
|
|
|
|
other related objects depending on the format). You can then either run the
|
|
|
|
tests in a mode to generate reference files from the arrays, or you can run
|
|
|
|
the tests in comparison mode, which will compare the results of the tests to
|
|
|
|
the reference ones within some tolerance.
|
|
|
|
|
|
|
|
At the moment, the supported file formats for the reference files are:
|
|
|
|
|
|
|
|
- A plain text-based format (baSed on Numpy loadtxt output)
|
|
|
|
- The FITS format (requires astropy). With this format, tests
|
|
|
|
can return either a Numpy array for a FITS HDU object.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytest-arraydiff-%{version}
|
|
|
|
|
2022-11-08 07:23:15 +00:00
|
|
|
%if !%{with test}
|
2018-08-14 20:33:04 +00:00
|
|
|
%build
|
2022-11-08 07:23:15 +00:00
|
|
|
%pyproject_wheel
|
2018-08-14 20:33:04 +00:00
|
|
|
|
|
|
|
%install
|
2022-11-08 07:23:15 +00:00
|
|
|
%pyproject_install
|
2018-08-14 20:33:04 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-02-13 13:27:45 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with test}
|
|
|
|
%check
|
2021-04-27 11:17:51 +00:00
|
|
|
# not installed in :test multiflavor
|
|
|
|
export PYTHONPATH="$PWD"
|
2022-11-08 07:23:15 +00:00
|
|
|
%pytest
|
2019-02-13 13:27:45 +00:00
|
|
|
%endif
|
2018-08-14 20:33:04 +00:00
|
|
|
|
2019-02-13 13:27:45 +00:00
|
|
|
%if !%{with test}
|
2018-08-14 20:33:04 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%doc CHANGES.md README.rst
|
|
|
|
%license LICENSE
|
2021-04-27 11:17:51 +00:00
|
|
|
%{python_sitelib}/pytest_arraydiff
|
|
|
|
%{python_sitelib}/pytest_arraydiff-%{version}*-info
|
2019-02-13 13:27:45 +00:00
|
|
|
%endif
|
2018-08-14 20:33:04 +00:00
|
|
|
|
|
|
|
%changelog
|