53be0f5
Name:           python-tabulate
cc9465a
Version:        0.9.0
4a7b463
Release:        %autorelease
431ea1b
Summary:        Pretty-print tabular data in Python, a library and a command-line utility
431ea1b
e813611
# SPDX
431ea1b
License:        MIT
cf62ef8
URL:            https://github.com/astanin/python-tabulate
8b0b7c1
Source0:        %{pypi_source tabulate}
8b0b7c1
# Hand-written for Fedora based on --help output using groff_man(7) format
8b0b7c1
Source1:        tabulate.1
431ea1b
431ea1b
BuildArch:      noarch
431ea1b
53be0f5
BuildRequires:  python3-devel
53be0f5
53be0f5
# Additional test deps; see tox.ini, not in the sdist
53be0f5
BuildRequires:  python3dist(pytest)
53be0f5
BuildRequires:  python3dist(numpy)
53be0f5
%if ! 0%{?el9}
53be0f5
# The pandas backport is not finished yet in EPEL 9. See BZ 2032550.
53be0f5
# The BR is needed only for Pandas integration tests.
53be0f5
BuildRequires:  python3dist(pandas)
53be0f5
%endif
53be0f5
20ad32a
%global _description %{expand:
20ad32a
The main use cases of the library are:
431ea1b
a994af6
• printing small tables without hassle: just one function call, formatting is
20ad32a
  guided by the data itself
a994af6
• authoring tabular data for lightweight plain-text markup: multiple output
20ad32a
  formats suitable for further editing or transformation
a994af6
• readable presentation of mixed textual and numeric data: smart column
20ad32a
  alignment, configurable number formatting, alignment by a decimal point}
37e750a
20ad32a
%description %{_description}
b69d7d6
53be0f5
53be0f5
%package -n python3-tabulate
431ea1b
Summary:        %{summary}
431ea1b
53be0f5
Recommends:     python3-tabulate+widechars
53be0f5
53be0f5
%description -n python3-tabulate %{_description}
37e750a
53be0f5
53be0f5
%pyproject_extras_subpkg -n python3-tabulate widechars
53be0f5
2108ba8
431ea1b
%prep
53be0f5
%autosetup -n tabulate-%{version}
53be0f5
53be0f5
53be0f5
%generate_buildrequires
53be0f5
%pyproject_buildrequires -x widechars
53be0f5
431ea1b
431ea1b
%build
53be0f5
%pyproject_wheel
53be0f5
431ea1b
431ea1b
%install
53be0f5
%pyproject_install
53be0f5
%pyproject_save_files tabulate
53be0f5
8b0b7c1
install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p '%{SOURCE1}'
8b0b7c1
0f3a900
b69d7d6
%check
169f490
%pytest --doctest-modules --ignore benchmark.py
b69d7d6
53be0f5
53be0f5
%files -n python3-tabulate -f %{pyproject_files}
2dea167
%doc CHANGELOG
2dea167
%doc README.md
53be0f5
53be0f5
%{_bindir}/tabulate
8b0b7c1
%{_mandir}/man1/tabulate.1*
53be0f5
b69d7d6
431ea1b
%changelog
4a7b463
%autochangelog