--- /dev/null
+--- xlsx2csv-0.7.6/test/run
++++ xlsx2csv-0.7.6/test/run
+@@ -5,8 +5,6 @@
+ import subprocess
+ from io import open
+
+-PYTHON_VERSIONS = ["2.7"]
+-
+ """
+ This test uses sys.stdout.
+ That means this test doesn't verify:
+@@ -16,31 +14,24 @@
+
+ def compare(case, arguments=[]):
+ failed = False
+- for pyver in PYTHON_VERSIONS:
+- ext = "xlsx"
+- if os.path.exists("test/%s.xlsm" % case):
+- ext = "xlsm"
+-
+- if os.name == 'posix':# in case of Linux
+- left = subprocess.check_output(["python%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','')
+- elif os.name == 'nt':# in case of Windows
+- # Use py.exe http://blog.python.org/2011/07/python-launcher-for-windows_11.html on Windows
+- left = subprocess.check_output(["py", "-%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','')
+- else:
+- print("os.name is unexpected: "+os.name)
+- sys.exit(1)
+-
+- f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="")
+- right = f.read().replace('\r','')
+- f.close()
+-
+- if left != right:
+- print("FAILED: %s %s" %(case, pyver))
+- print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n"))
+- print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n"))
+- failed = True
+- else:
+- print("OK: %s %s" %(case, pyver))
++ ext = "xlsx"
++ if os.path.exists("test/%s.xlsm" % case):
++ ext = "xlsm"
++
++ left = subprocess.check_output(["./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','')
++
++ f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="")
++ right = f.read().replace('\r','')
++ f.close()
++
++ if left != right:
++ print("FAILED: %s" % (case,))
++ print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n"))
++ print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n"))
++ failed = True
++ else:
++ print("OK: %s" % (case,))
++
+ if failed:
+ sys.exit(1)
+
--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
+PYTHON_REQ_USE="xml"
+
+inherit distutils-r1
+
+DESCRIPTION="Convert MS Office xlsx files to CSV"
+HOMEPAGE="https://github.com/dilshod/xlsx2csv/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="dev-lang/perl"
+
+PATCHES=( "${FILESDIR}"/${P}-tests.patch )
+
+python_compile_all() {
+ emake -C man
+}
+
+python_test() {
+ "${PYTHON}" test/run || die "tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ doman man/${PN}.1
+}