# # spec file for package python-prettytable # # Copyright (c) 2022 SUSE LLC # Copyright (c) 2011 Christian Berendt. # # 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/ # %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 %define skip_python36 1 %define skip_python39 1 Name: python-prettytable Version: 3.2.0 Release: 1.1 Summary: Library for displaying tabular data in formatted fashion License: BSD-2-Clause URL: https://github.com/jazzband/prettytable Source0: https://files.pythonhosted.org/packages/source/p/prettytable/prettytable-%{version}.tar.gz BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module importlib-metadata if %python-base < 3.8} BuildRequires: %{python_module pytest-lazy-fixture} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wcwidth} BuildRequires: %{pythons} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch Requires: python-wcwidth %if 0%{?python_version_nodots} < 38 Requires: python-importlib-metadata %endif Provides: python-PrettyTable = %{version}-%{release} Obsoletes: python-PrettyTable < %{version}-%{release} %python_subpackages %description PrettyTable is a Python library for representing tabular data in ASCII tables, inspired by the tables emitted by the PostgreSQL shell, psql. PrettyTable allows for selection of which columns are to be printed, independent alignment of columns (left or right justified or centred) and printing of "sub-tables" by specifying a row range. %prep %setup -q -n prettytable-%{version} sed -i '1 {/env python/d}' src/prettytable/prettytable.py %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export LANG=en_US.UTF-8 %pytest %files %{python_files} %license COPYING %doc CHANGELOG.md README.md %{python_sitelib}/prettytable %{python_sitelib}/prettytable-%{version}*-info %changelog * Wed Mar 30 2022 Ben Greiner - Update to 3.2.0 * Drop support for EOL Python 3.6 (#152) @hugovk * Use tags to print html table titles (#160) @daibhid * Add colorful tables and themes (#140) @BD103 * Convert None to empty cell or custom value (#164) @av-guy * Resolve "KeyError" issue on _stringify_row (#167) @michal-jagiello-tmpl * Use concrete built-in exceptions instead of Exception base class (#169) @hugovk * Fix width for custom none_format (#174) @av-guy * Enforce max widths for field names (#171) @OlafvdSpek * Mon Jan 3 2022 Dirk Müller - update to 2.5.0: * Add Single Border table style * Thu Nov 25 2021 Ben Greiner - Fix missing importlib-metadata requirement * Wed Nov 24 2021 Matej Cepl - Rename package according to the PyPI name - wcwidth is also required dependency * Mon Nov 8 2021 Dirk Müller - update to 2.4.0: * Markdown: Add colons to align the rendered output * Add rows attribute to prettytable * Add Jupyter repr and default interpreter repr methods * Add custom format support * Add method to generate LaTex formatted string * Add support for Python 3.10 * Update issue templates * Add support for positional junction characters and add "double_border" table style * Access properties instead of protected fields in _get_options() * Use declarative metadata and support PyPy3 * Add auto index column * Support formatting options in get_json_string() * Add tbody and thead tags * Add add_rows to add several rows at once * Add setuptools as a dependency * Fix string comparison and deprecation warning - skip python2 * Fri Oct 15 2021 pgajdos@suse.com - %%check: use %%pyunittest rpm macro * Tue Nov 10 2020 Steve Kowalik - Update URL/Source0 due to Google Code Hosting being dead since 2016 * Thu Nov 7 2019 Matej Cepl - Run through spec-cleaner * Tue Dec 4 2018 Matej Cepl - Remove superfluous devel dependency for noarch package * Tue Sep 5 2017 jengelh@inai.de - Make description neutral. * Fri Sep 1 2017 sebix+novell.com@sebix.at - activate tests - remove shebang from prettytable.py - run spec-cleaner * Wed Aug 23 2017 tbechtold@suse.com - convert to singlespec * Thu Oct 24 2013 speilicke@suse.com - Require python-setuptools instead of distribute (upstreams merged) * Fri Apr 26 2013 speilicke@suse.com - Run testsuite * Fri Feb 22 2013 saschpe@suse.de - Use upstream URL and fix copyright * Mon Feb 18 2013 p.drouand@gmail.com - Update to version 0.7: + Improved Python 2 and 3 compatibility (2.4-3.2). + Improved support for non-Latin characters. Table widths should now be calculated correctly for tables with e.g. Japanese text. + Table contents can now be read in from a .csv file + Table contents can now be read in from a DB-API compatible cursor + Table contents can now be read in from a string containing a HTML table + new valign attribute controls vertical alignment of text when some cells in a row have multiple lines of text and others don't. + hrules attribute can now be set to HEADER, which draws a rule only under the header row + new vrules attribute controls drawing of vertical rules and can be set to FRAME, ALL or NONE + new header_style attribute controls formatting of text in table headers and can be set to "cap", "title", "upper", "lower" or None + Fixed a simple bug regarding validation of max_width + Fixed a simple bug regarding initialisation of int_format value for new tables + Fixed a bug regarding some constructor keywords, such as "border", being ignored * Thu Jul 26 2012 saschpe@suse.de - Update to version 0.6.1: + Unicode encoding scheme can now be set by user + __str__ now uses user-specified encoding instead of ASCII. This fixes a bug where tables with non-ASCII characters would print correctly with "print x.get_string()" but not "print x" in 2.x (thanks to Google Code user kevincobain2000 for reporting this bug!) + Fixed an incompatibility with 3.0 and 3.1 (html.escape was new in 3.2) - Changes from version 0.6.0: + Code is now simultaneously compatible with Python 2 and 3 + Replaced all setter methods with managed attributes + All styling options can now be set persistently as managed attributes + Added "add_style" method to make setting style options easily + Added "del_row", "clear_rows" and "clear" methods to facilitate removal of data from table. + Added "copy" method to facilitate cloning of a table. + Removed caching functionality, which added complexity and fragility for relatively little gain + Removed methods that just printed strings produced by get_string and get_html_string - just use inbuilt print! + Improved unicode support + Added support for decimal and floating point number formatting support + Added support for using a custom key sorting methods + Added support for line breaks in data + Added support for max column widths + Fixed table slicing + Fixed bug where closing tags in HTML tables were not printed + Fixed HTML table sorting bug + Fixed bug whereby changing field_names did not recompute widths * Wed Nov 30 2011 cfarrell@suse.com - license update: BSD-2-Clause SPDX * Tue Nov 29 2011 saschpe@suse.de - Make it a noarch package - %%py_requires needed for SLE * Tue Nov 29 2011 idoenmez@suse.de - Add license boilerplate * Thu Nov 24 2011 idoenmez@suse.de - Name field shouldn't contain a macro * Wed Apr 20 2011 berendt@b1-systems.de - created initial spec file using version 0.5