app-text/xlsx2csv: version bump to 0.7.6
authorTim Harder <radhermit@gentoo.org>
Sun, 17 Nov 2019 04:49:01 +0000 (21:49 -0700)
committerTim Harder <radhermit@gentoo.org>
Sun, 17 Nov 2019 05:06:51 +0000 (22:06 -0700)
Signed-off-by: Tim Harder <radhermit@gentoo.org>
app-text/xlsx2csv/Manifest
app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch [new file with mode: 0644]
app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild [new file with mode: 0644]

index b0b0730369964096ebb7b97b5ae786b19cdef476..7dbc902e10fa7a48b8043047f6f005bd594b65a5 100644 (file)
@@ -1,2 +1,3 @@
 DIST xlsx2csv-0.7.3.tar.gz 201482 BLAKE2B a2268e584097777d28f2565a19d0f271cb694066e1abffffd7578ecf0271efd420af63932eaea4389c062e050da257fa2f7164c9de7cdfa4ab3fd416692e7968 SHA512 855fcce9ae6ec51c46673e085a456d2862912d0da5130fdac34d88e5612c64d2bc0674c13b3bfb6cd6b7017e513fe0924dbb594db543020842705a82b6006e8e
 DIST xlsx2csv-0.7.4.tar.gz 212472 BLAKE2B de77f4d199bd5fbb43fb4aa775aed9b36aea4c956846be42e9387b79bf76727ba457a0c54db3b4803376b82af12923f21786aa34d21542e2d6ab354be33ad3f3 SHA512 771af30dce63b64272fc8d4dccbcab2106f60a2c9d33370b4d4034a21606e5726c84d963d59e88e2aa124c60f62fd57831ca5fb442d7540474ff1d688da9aaf6
+DIST xlsx2csv-0.7.6.tar.gz 231283 BLAKE2B d0271c6a82b7ed2825e3224f0e34637db3dacda3fe99c6ef5a087cc8d248592efc169b466514abd18b50f6625e8d9743c812b46ecb6f76ce7d1fdc51dfe34fc4 SHA512 7fc8e0da0c050e12d0cfd73f16ffd9c00f19bf05925b54cc68d6a0858a75db89d52e46312956dfd149e0ec88778f68056942a090db44e6148796fad33fa26489
diff --git a/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch b/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch
new file mode 100644 (file)
index 0000000..f3e04b8
--- /dev/null
@@ -0,0 +1,61 @@
+--- 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)
diff --git a/app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild b/app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild
new file mode 100644 (file)
index 0000000..a23cd85
--- /dev/null
@@ -0,0 +1,33 @@
+# 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
+}