File python-tt-flash.spec of Package python-tt-flash

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

%define skip_python2 1

Name:           python-tt-flash
Version:        3.0.0
Release:        0
Summary:        Tenstorrent firmware updater
License:        Apache-2.0
Group:          System/Kernel
URL:            https://github.com/tenstorrent/tt-flash
Source0:        https://github.com/tenstorrent/tt-flash/archive/refs/tags/v%{version}.tar.gz#/tt-flash-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires:       python-PyYAML
Requires:       python-pyluwen
Requires:       python-tabulate
Requires:       python-tt-tools-common
BuildArch:      noarch

%python_subpackages

%description
This package contains firmware update tools for Tenstorrent cards.

%prep
%setup -q -n tt-flash-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/tt-flash
%python3_fix_shebang
%python_expand %fdupes %{buildroot}%{$python_sitelib}/tt_flash

%post
%python_install_alternative tt-flash

%postun
%python_uninstall_alternative tt-flash

%files %{python_files}
%python_alternative %{_bindir}/tt-flash
%{python_sitelib}/tt_flash
%{python_sitelib}/tt_flash-%{version}*-info

%changelog
openSUSE Build Service is sponsored by