File python-pomegranate.spec of Package python-pomegranate

#
# spec file for package python-pomegranate
#
# Copyright (c) 2021 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/
#


# PyTorch currently fails with Python 3.13's pickle changes
%define skip_python313 1
Name:           python-pomegranate
Version:        1.1.0
Release:        0
Summary:        A PyTorch implementation of probabilistic models
License:        MIT
URL:            https://github.com/jmschrei/pomegranate
Source:         https://github.com/jmschrei/pomegranate/archive/refs/tags/v%{version}.tar.gz#/pomegranate-%{version}.tar.gz
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module torch >= 1.9}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-networkx >= 2.8.4
Requires:       python-numpy >= 1.22.2
Requires:       python-apricot-select >= 0.6
Requires:       python-torch >= 1.9
Requires:       python-scipy >= 1.6.2
Requires:       python-scikit-learn >= 1.0.2
# SECTION test requirements
BuildRequires:  %{python_module networkx >= 2.8.4}
BuildRequires:  %{python_module numpy-devel >= 1.22.2}
BuildRequires:  %{python_module apricot-select >= 0.6}
BuildRequires:  %{python_module scipy >= 1.6.2}
BuildRequires:  %{python_module sympy}
BuildRequires:  %{python_module scikit-learn >= 1.0.2}
BuildRequires:  %{python_module pytest}
BuildArch:      noarch
# /SECTION
%python_subpackages

%description
pomegranate is a library for probabilistic modeling defined by its modular
implementation and treatment of all models as the probability distributions
they are.

Recently, pomegranate (v1.0.0) was rewritten from the ground up using PyTorch
to replace the outdated Cython backend.

%prep
%setup -q -n pomegranate-%{version}
#touch tests/__init__.py

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
%pytest -k 'not test_sample'

%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/pomegranate
%{python_sitelib}/pomegranate-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by