File python-halo.spec of Package python-halo
#
# spec file for package python-halo
#
# 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 _commit c5f6ef233d5a3ef6c3db9f44aef03a789cb4a6ce
%define skip_python39 1
%bcond_without test
Name: python-halo
Version: 0.0.31
Release: 0
Summary: Beautiful terminal spinners in Python
License: MIT
Group: Development/Languages/Python
URL: https://github.com/manrajgrover/halo
Source: https://github.com/manrajgrover/halo/archive/%{_commit}.tar.gz#/halo-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module spinners}
BuildRequires: %{python_module termcolor}
BuildRequires: %{python_module log_symbols}
BuildRequires: %{python_module six}
BuildRequires: %{python_module ipywidgets}
BuildRequires: %{python_module pytest}
%endif
Requires: python-colorama >= 0.3.9
Requires: python-log_symbols >= 0.0.14
Requires: python-six >= 1.12.0
Requires: python-spinners >= 0.0.24
Requires: python-termcolor >= 1.1.0
Suggests: python-IPython >= 5.7.0
Suggests: python-ipywidgets >= 7.1.0
BuildArch: noarch
%python_subpackages
%description
Beautiful terminal spinners in Python.
%prep
%autosetup -p1 -n halo-%{_commit}
# Python 3.12 compatibility
sed -i 's/assertRegexpMatches/assertRegex/g' tests/test_halo.py tests/test_halo_notebook.py
sed -i 's/assertEquals/assertEqual/g' tests/test_halo.py tests/test_halo_notebook.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
# coloring does not work in OBS
%pytest -k "not color"
%endif
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/halo
%{python_sitelib}/halo-%{version}.dist-info
%changelog