Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Mar 2022 18:27:27 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 2c70c255c802 - main - textproc/py-tabletext: Fix build with setuptools 58.0.0+
Message-ID:  <202203071827.227IRRVo086018@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2c70c255c80278ddde5959b1bf0ab7b4fe9cc3af

commit 2c70c255c80278ddde5959b1bf0ab7b4fe9cc3af
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-03-07 18:07:58 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-03-07 18:13:21 +0000

    textproc/py-tabletext: Fix build with setuptools 58.0.0+
---
 textproc/py-tabletext/files/patch-2to3 | 71 ++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/textproc/py-tabletext/files/patch-2to3 b/textproc/py-tabletext/files/patch-2to3
new file mode 100644
index 000000000000..4d9e86857754
--- /dev/null
+++ b/textproc/py-tabletext/files/patch-2to3
@@ -0,0 +1,71 @@
+--- setup.py.orig	2014-08-14 18:05:14 UTC
++++ setup.py
+@@ -13,6 +13,5 @@ setup(name='tabletext',
+       author_email='thibaut.horel+tabletext@gmail.com',
+       py_modules=['tabletext'],
+       entry_points={"console_scripts": ["table=tabletext:main"]},
+-      use_2to3=True,
+       license='GNU GPLv3'
+       )
+--- tabletext.py.orig	2014-08-14 00:50:38 UTC
++++ tabletext.py
+@@ -16,20 +16,20 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+-from __future__ import unicode_literals
++
+ import re
+ from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter,\
+     RawDescriptionHelpFormatter
+ import sys
+ from codecs import open, getwriter
+-from itertools import izip_longest
++from itertools import zip_longest
+ 
+ 
+ __all__ = ["to_text"]
+ 
+ 
+ def _get_widths(table, formats, padding):
+-    columns = izip_longest(*table, fillvalue="")
++    columns = zip_longest(*table, fillvalue="")
+     return [max(len(_format_entry(entry, format_string, padding))
+                 for entry in column)
+             for column, format_string in zip(columns, formats)]
+@@ -63,7 +63,7 @@ def _format_entry(entry, format_string, padding):
+ def _format_row(row, formats, padding, ver):
+     return (ver + ver.join(_format_entry(entry, format_string, padding)
+                            for entry, format_string
+-                           in izip_longest(row, formats, fillvalue=""))
++                           in zip_longest(row, formats, fillvalue=""))
+             + ver)
+ 
+ 
+@@ -85,7 +85,7 @@ def to_text(table, formats=None, padding=(1, 1), corne
+     n_columns = max(len(row) for row in table)
+     if not formats:
+         formats = [""] * n_columns
+-    elif type(formats) is unicode:
++    elif type(formats) is str:
+         formats = [formats] * n_columns
+     if len(corners) == 1:
+         corners = corners * 9
+@@ -131,7 +131,7 @@ For more details and bug reports, see: https://github.
+                         default=[1, 1])
+     parser.add_argument("--format", help="format string for the table entries",
+                         default="", dest="formats", metavar="FORMAT",
+-                        type=unicode)
++                        type=str)
+     parser.add_argument("--header", help="format first row as header",
+                         action="store_true")
+     parser.add_argument("--hhor", help="horizontal line character \
+@@ -169,7 +169,7 @@ There is NO WARRANTY, to the extent permitted by law. 
+     del args["sep"]
+     if sys.version < '3':
+         sys.stdout = getwriter('utf8')(sys.stdout)
+-    print to_text(table, **args)
++    print(to_text(table, **args))
+ 
+ if __name__ == "__main__":
+     main()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203071827.227IRRVo086018>