summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-30 07:47:59 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-30 08:02:55 +0200
commitc188ba0d3efb81b4708dc5baf19b9bfbcb6248cf (patch)
treef69f6c5a0989e3d137e5ea310a3ef791f8e456e0 /dev-python/terminaltables
parentdev-python/tabulate: Bump to 0.8.7 (diff)
downloadgentoo-c188ba0d3efb81b4708dc5baf19b9bfbcb6248cf.tar.gz
gentoo-c188ba0d3efb81b4708dc5baf19b9bfbcb6248cf.tar.bz2
gentoo-c188ba0d3efb81b4708dc5baf19b9bfbcb6248cf.zip
dev-python/terminaltables: Port to py3.9, fix tests
Closes: https://bugs.gentoo.org/723590 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/terminaltables')
-rw-r--r--dev-python/terminaltables/files/terminaltables-3.1.0-stdout.patch23
-rw-r--r--dev-python/terminaltables/terminaltables-3.1.0.ebuild19
-rw-r--r--dev-python/terminaltables/terminaltables-9999.ebuild10
3 files changed, 36 insertions, 16 deletions
diff --git a/dev-python/terminaltables/files/terminaltables-3.1.0-stdout.patch b/dev-python/terminaltables/files/terminaltables-3.1.0-stdout.patch
new file mode 100644
index 000000000000..e463ff66f93b
--- /dev/null
+++ b/dev-python/terminaltables/files/terminaltables-3.1.0-stdout.patch
@@ -0,0 +1,23 @@
+From 9cb9d0ef11fac861e46776fb18cef309df28c234 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 30 Jul 2020 07:59:05 +0200
+Subject: [PATCH] Fix writing binary data to sys.stdout
+
+---
+ terminaltables/terminal_io.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/terminaltables/terminal_io.py b/terminaltables/terminal_io.py
+index 8b8c10d..310263c 100644
+--- a/terminaltables/terminal_io.py
++++ b/terminaltables/terminal_io.py
+@@ -94,5 +94,5 @@ def set_terminal_title(title, kernel32=None):
+ return kernel32.SetConsoleTitleW(title) != 0
+
+ # Linux/OSX.
+- sys.stdout.write(b'\033]0;' + title_bytes + b'\007')
++ sys.stdout.buffer.write(b'\033]0;' + title_bytes + b'\007')
+ return True
+--
+2.28.0
+
diff --git a/dev-python/terminaltables/terminaltables-3.1.0.ebuild b/dev-python/terminaltables/terminaltables-3.1.0.ebuild
index 384bf33858ef..86d74c67298e 100644
--- a/dev-python/terminaltables/terminaltables-3.1.0.ebuild
+++ b/dev-python/terminaltables/terminaltables-3.1.0.ebuild
@@ -3,27 +3,28 @@
EAPI=7
-PYTHON_COMPAT=( python{3_6,3_7} )
+PYTHON_COMPAT=( python3_{6..9} )
inherit distutils-r1
DESCRIPTION="Generate simple tables in terminals from a nested list of strings"
HOMEPAGE="https://robpol86.github.io/terminaltables"
-SRC_URI="https://github.com/Robpol86/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI="
+ https://github.com/Robpol86/terminaltables/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+BDEPEND="
test? (
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/colorclass[${PYTHON_USEDEP}]
- dev-python/pytest[${PYTHON_USEDEP}]
dev-python/termcolor[${PYTHON_USEDEP}]
)"
-python_test() {
- pytest -vv || die "Tests fail with ${EPYTHON}"
-}
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/terminaltables-3.1.0-stdout.patch
+)
diff --git a/dev-python/terminaltables/terminaltables-9999.ebuild b/dev-python/terminaltables/terminaltables-9999.ebuild
index a855b1d99da0..7bacaa3fb7cd 100644
--- a/dev-python/terminaltables/terminaltables-9999.ebuild
+++ b/dev-python/terminaltables/terminaltables-9999.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python{3_6,3_7} )
+PYTHON_COMPAT=( python3_{6..9} )
EGIT_REPO_URI="https://github.com/Robpol86/${PN}.git"
inherit distutils-r1 git-r3
@@ -14,10 +14,8 @@ SRC_URI=""
LICENSE="MIT"
SLOT="0"
KEYWORDS=""
-IUSE="test"
-RESTRICT="!test? ( test )"
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+BDEPEND="
test? (
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/colorclass[${PYTHON_USEDEP}]
@@ -25,6 +23,4 @@ DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
dev-python/termcolor[${PYTHON_USEDEP}]
)"
-python_test() {
- pytest -vv || die "Tests fail with ${EPYTHON}"
-}
+distutils_enable_tests pytest