2016-10-10 20:41:23 +00:00
|
|
|
|
#
|
2024-10-30 02:58:53 +00:00
|
|
|
|
# spec file for package python-humanfriendly
|
2016-10-10 20:41:23 +00:00
|
|
|
|
#
|
2025-07-10 13:11:06 +00:00
|
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2016-07-15 18:12:44 +00:00
|
|
|
|
#
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
2019-01-31 11:32:32 +00:00
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-10-10 20:41:23 +00:00
|
|
|
|
#
|
|
|
|
|
|
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
2018-08-21 08:00:58 +00:00
|
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
%if "%{flavor}" == "test"
|
2019-03-29 10:46:34 +00:00
|
|
|
|
%define psuffix test
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%bcond_without test
|
|
|
|
|
|
%else
|
2019-03-29 10:46:34 +00:00
|
|
|
|
%define psuffix %{nil}
|
2018-08-21 08:00:58 +00:00
|
|
|
|
%bcond_with test
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%endif
|
2025-07-10 13:11:06 +00:00
|
|
|
|
%bcond_without libalternatives
|
2023-04-21 14:31:44 +00:00
|
|
|
|
%{?sle15_python_module_pythons}
|
2019-03-29 10:46:34 +00:00
|
|
|
|
Name: python-humanfriendly%{psuffix}
|
2021-11-21 11:00:41 +00:00
|
|
|
|
Version: 10.0
|
2016-07-15 18:12:44 +00:00
|
|
|
|
Release: 0
|
|
|
|
|
|
Summary: Human friendly input/output for text interfaces using Python
|
|
|
|
|
|
License: MIT
|
2018-08-21 07:54:13 +00:00
|
|
|
|
URL: https://github.com/xolox/python-humanfriendly
|
2017-09-06 16:38:28 +00:00
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/h/humanfriendly/humanfriendly-%{version}.tar.gz
|
2022-03-21 14:23:27 +00:00
|
|
|
|
# https://github.com/xolox/python-humanfriendly/issues/62
|
|
|
|
|
|
Patch0: python-humanfriendly-no-mock.patch
|
2022-07-29 07:43:15 +00:00
|
|
|
|
# PATCH-FIX-UPSTREAM gh#xolox/python-humanfriendly#65
|
|
|
|
|
|
Patch1: pytest-7-support.patch
|
2024-10-30 02:58:53 +00:00
|
|
|
|
# PATCH-FIX-UPSTREAM gh#xolox/python-humanfriendly#75
|
|
|
|
|
|
Patch2: support-python-313.patch
|
|
|
|
|
|
BuildRequires: %{python_module pip}
|
2018-08-21 08:00:58 +00:00
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-10-30 02:58:53 +00:00
|
|
|
|
BuildRequires: %{python_module wheel}
|
2025-07-10 13:11:06 +00:00
|
|
|
|
BuildRequires: alts
|
2018-08-21 08:00:58 +00:00
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2025-07-10 13:11:06 +00:00
|
|
|
|
Requires: alts
|
2019-12-11 08:57:49 +00:00
|
|
|
|
Requires: python
|
2018-08-21 08:00:58 +00:00
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
%if %{with test}
|
2018-08-21 07:54:13 +00:00
|
|
|
|
BuildRequires: %{python_module capturer >= 2.1}
|
2017-09-06 16:38:28 +00:00
|
|
|
|
BuildRequires: %{python_module coloredlogs >= 2}
|
2020-02-15 07:55:33 +00:00
|
|
|
|
BuildRequires: %{python_module docutils}
|
2018-08-21 07:54:13 +00:00
|
|
|
|
BuildRequires: %{python_module pytest >= 3.0.7}
|
|
|
|
|
|
BuildRequires: %{python_module pytest-cov >= 2.4.0}
|
2019-12-11 08:57:49 +00:00
|
|
|
|
BuildRequires: %{pythons}
|
2017-09-06 16:38:28 +00:00
|
|
|
|
%endif
|
|
|
|
|
|
%python_subpackages
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
%description
|
2016-10-10 20:41:23 +00:00
|
|
|
|
The functions and classes in the humanfriendly package can be used to make
|
|
|
|
|
|
text interfaces more user friendly.
|
|
|
|
|
|
|
|
|
|
|
|
Some example features:
|
|
|
|
|
|
* Parsing and formatting numbers, file sizes, pathnames and timespans in
|
|
|
|
|
|
simple, human friendly formats.
|
|
|
|
|
|
* Easy to use timers for long running operations, with human friendly
|
|
|
|
|
|
formatting of the resulting timespans.
|
|
|
|
|
|
* Prompting the user to select a choice from a list of options by typing
|
|
|
|
|
|
the option’s number or a unique substring of the option.
|
|
|
|
|
|
* Terminal interaction including text styling (ANSI escape sequences), user
|
|
|
|
|
|
friendly rendering of usage messages and querying the terminal for its size.
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-07-29 07:43:15 +00:00
|
|
|
|
%autosetup -p1 -n humanfriendly-%{version}
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
%build
|
2024-10-30 02:58:53 +00:00
|
|
|
|
%pyproject_wheel
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
%install
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%if !%{with test}
|
2024-10-30 02:58:53 +00:00
|
|
|
|
%pyproject_install
|
2017-09-06 16:38:28 +00:00
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/humanfriendly
|
|
|
|
|
|
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/humanfriendly/tests.py
|
2018-08-21 07:54:13 +00:00
|
|
|
|
sed -i "s|#!%{_bindir}/env python|#!%__$python|" %{buildroot}%{$python_sitelib}/humanfriendly/tests.py
|
2017-09-06 16:38:28 +00:00
|
|
|
|
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/humanfriendly/
|
|
|
|
|
|
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/humanfriendly/
|
|
|
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
}
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%endif
|
2017-09-06 16:38:28 +00:00
|
|
|
|
|
2019-03-29 10:46:34 +00:00
|
|
|
|
%if %{with test}
|
|
|
|
|
|
%check
|
|
|
|
|
|
%pytest humanfriendly/tests.py
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%if !%{with test}
|
2025-07-10 13:11:06 +00:00
|
|
|
|
%pre
|
|
|
|
|
|
%python_libalternatives_reset_alternative humanfriendly
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
2017-09-06 16:38:28 +00:00
|
|
|
|
%files %{python_files}
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
|
%doc README.rst
|
2017-09-06 16:38:28 +00:00
|
|
|
|
%python_alternative %{_bindir}/humanfriendly
|
2016-10-10 20:41:23 +00:00
|
|
|
|
%{python_sitelib}/humanfriendly
|
2024-10-30 02:58:53 +00:00
|
|
|
|
%{python_sitelib}/humanfriendly-%{version}.dist-info
|
2018-08-21 07:54:13 +00:00
|
|
|
|
%endif
|
2016-07-15 18:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
%changelog
|