File python-einops.spec of Package python-einops

#
# spec file for package python-einops
#
# 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/
#

%{?sle15_python_module_pythons}
Name:           python-einops
Version:        0.8.0
Release:        0
Summary:        A new flavour of deep learning operations
License:        MIT
URL:            https://github.com/arogozhnikov/einops
Source:         %{url}/archive/refs/tags/v0.8.0.tar.gz#/einops-%{version}.tar.gz
Patch0:         einops-fix-tests-numpy-2-0-0.patch
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module hatchling >= 1.10.0}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module pip}
BuildRequires:  fdupes
BuildArch:      noarch
%python_subpackages

%description
Flexible and powerful tensor operations for readable and reliable code.
Supports numpy, pytorch, tensorflow, jax, and others.

%prep
%autosetup -p1 -n einops-%{version}

%build
%pyproject_wheel

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

%check
export EINOPS_TEST_BACKENDS=numpy
%pytest "--ignore=tests/test_notebooks.py" "--ignore=tests/test_other.py"

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

%changelog
openSUSE Build Service is sponsored by