summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuildTools2019-12-10 22:32:22 -0500
committerBuildTools2019-12-10 22:32:22 -0500
commit0bfee1fbd263da30de6820162d58b733a763f8c3 (patch)
treecc4868e1e1d084fdc93e9e153e67d36642d36c13
parent53ca540ea574a8d4bcd6ffba98f45c2f87e519a5 (diff)
downloadaur-0bfee1fbd263da30de6820162d58b733a763f8c3.tar.gz
added python2-test.patch
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD13
-rw-r--r--python2-test.patch32
3 files changed, 45 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1bebe2979c0c..0710a351d2c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-num2words
pkgdesc = Python modules to convert numbers to words.
pkgver = 0.5.10
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/savoirfairelinux/num2words
arch = any
license = LGPL
@@ -10,7 +10,9 @@ pkgbase = python-num2words
makedepends = python-setuptools
makedepends = python2-setuptools
source = https://github.com/savoirfairelinux/num2words/archive/v0.5.10.tar.gz
+ source = python2-test.patch
sha256sums = ff107ecc0b6709bedf31fdb9e2ca45d29d3fd34b9eb6a0b89a862f337ac5ff00
+ sha256sums = 059b34631c5d4f6d8bf7cda6681027e96b48a0a4e2e49c14759d0aeaed800398
pkgname = python-num2words
pkgdesc = Python modules to convert numbers to words. (python3 version)
diff --git a/PKGBUILD b/PKGBUILD
index 9eabd817b25c..a10be6eb3020 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,15 +3,22 @@
pkgbase=python-num2words
pkgname=('python-num2words' 'python2-num2words')
pkgver=0.5.10
-pkgrel=1
+pkgrel=2
pkgdesc="Python modules to convert numbers to words."
arch=('any')
url='https://github.com/savoirfairelinux/num2words'
license=('LGPL')
makedepends=('python-setuptools' 'python2-setuptools')
checkdepends=('python' 'python2')
-source=("https://github.com/savoirfairelinux/num2words/archive/v${pkgver}.tar.gz")
-sha256sums=('ff107ecc0b6709bedf31fdb9e2ca45d29d3fd34b9eb6a0b89a862f337ac5ff00')
+source=("https://github.com/savoirfairelinux/num2words/archive/v${pkgver}.tar.gz"
+ 'python2-test.patch')
+sha256sums=('ff107ecc0b6709bedf31fdb9e2ca45d29d3fd34b9eb6a0b89a862f337ac5ff00'
+ '059b34631c5d4f6d8bf7cda6681027e96b48a0a4e2e49c14759d0aeaed800398')
+
+prepare() {
+ cd "${srcdir}/num2words-${pkgver}"
+ patch -p1 < ../python2-test.patch
+}
check() {
cd "${srcdir}/num2words-${pkgver}"
diff --git a/python2-test.patch b/python2-test.patch
new file mode 100644
index 000000000000..132c87fe3c39
--- /dev/null
+++ b/python2-test.patch
@@ -0,0 +1,32 @@
+diff -ruN num2words-0.5.10.orig/bin/num2words num2words-0.5.10/bin/num2words
+--- num2words-0.5.10.orig/bin/num2words 2019-09-07 00:06:15.933230111 +0300
++++ num2words-0.5.10/bin/num2words 2019-09-07 00:08:57.515532720 +0300
+@@ -82,7 +82,7 @@
+ sys.exit(0)
+ try:
+ words = num2words.num2words(args['<number>'], lang=args['--lang'], to=args['--to'])
+- sys.stdout.write(words+os.linesep)
++ sys.stdout.write((words.encode("utf-8") if sys.version_info[0] == 2 else words) + os.linesep)
+ sys.exit(0)
+ except Exception as err:
+ sys.stderr.write(str(args['<number>']))
+diff -ruN num2words-0.5.10.orig/tests/test_cli.py num2words-0.5.10/tests/test_cli.py
+--- num2words-0.5.10.orig/tests/test_cli.py 2019-09-07 00:06:15.939896873 +0300
++++ num2words-0.5.10/tests/test_cli.py 2019-09-07 00:06:40.363578331 +0300
+@@ -20,6 +20,7 @@
+
+ import os
+ import unittest
++import sys
+
+ import delegator
+
+@@ -31,7 +32,7 @@
+ def __init__(self):
+ self.cmd = os.path.realpath(os.path.join(os.path.dirname(__file__),
+ "..", "bin", "num2words"))
+- self.cmd_list = ["python", self.cmd]
++ self.cmd_list = [sys.executable, self.cmd]
+
+ def run_cmd(self, *args):
+ cmd_list = self.cmd_list + [str(arg) for arg in args]