File python-apricot-select.spec of Package python-apricot-select
#
# spec file for package python-apricot-select
#
# Copyright (c) 2024 SUSE LLC
#
# 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
%else
%define psuffix -%{flavor}
%bcond_without test
%if "%{flavor}" != "test-py311"
%define skip_python311 1
%endif
%if "%{flavor}" != "test-py312"
%define skip_python312 1
%endif
%if "%{flavor}" != "test-py313"
%define skip_python313 1
%endif
%endif
Name: python-apricot-select%{psuffix}
Version: 0.6.1
Release: 0
Summary: Submodular selection of representative sets for ML models
License: MIT
URL: http://pypi.python.org/pypi/apricot-select/
Source: https://github.com/jmschrei/apricot/archive/refs/tags/%{version}.tar.gz#/apricot-select-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#jmschrei/apricot#40
Patch0: drop-torch.patch
# PATCH-FIX-OPENSUSE Remove nose
Patch1: remove-nose.patch
# PATCH-FIX-OPENSUSE Support numpy 2
Patch2: support-numpy-2.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
# SECTION test requirements
%if %{with test}
BuildRequires: %{python_module apricot-select = %{version}}
BuildRequires: %{python_module pytest}
%endif
# /SECTION
BuildRequires: fdupes
Requires: python-numba >= 0.43.0
Requires: python-numpy >= 1.14.2
Requires: python-scipy >= 1.0.0
Requires: python-scikit-learn >= 0.22
Requires: python-tqdm >= 4.24.0
BuildArch: noarch
%python_subpackages
%description
apricot is a package for submodular selection of representative sets for machine learning models.
%prep
%autosetup -p1 -n apricot-%{version}
%build
%pyproject_wheel
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%pytest -k 'not (test_digits_modular or test_digits_sqrt_modular)'
%endif
%if !%{with test}
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/apricot
%{python_sitelib}/apricot_select-%{version}.dist-info
%endif
%changelog