dev-python/xlutils: add py3 compat
authorVirgil Dupras <vdupras@gentoo.org>
Wed, 8 May 2019 14:40:02 +0000 (10:40 -0400)
committerVirgil Dupras <vdupras@gentoo.org>
Wed, 8 May 2019 14:41:17 +0000 (10:41 -0400)
Also, fix tests.

Closes: https://bugs.gentoo.org/655826
Closes: https://bugs.gentoo.org/663412
Signed-off-by: Virgil Dupras <vdupras@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch [new file with mode: 0644]
dev-python/xlutils/xlutils-2.0.0-r1.ebuild [moved from dev-python/xlutils/xlutils-2.0.0.ebuild with 51% similarity]

diff --git a/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch b/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch
new file mode 100644 (file)
index 0000000..b7e7492
--- /dev/null
@@ -0,0 +1,23 @@
+From e9edf279ba2e699be92da7611368cf92b4d87cec Mon Sep 17 00:00:00 2001
+From: Chris Withers <chris@simplistix.co.uk>
+Date: Wed, 4 Apr 2018 08:05:06 +0100
+Subject: [PATCH] fix test expectations
+
+---
+ xlutils/tests/test_view.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/xlutils/tests/test_view.py b/xlutils/tests/test_view.py
+index 7b32892..5b4aa2b 100644
+--- a/xlutils/tests/test_view.py
++++ b/xlutils/tests/test_view.py
+@@ -219,6 +219,8 @@ def test_does_not_match(self):
+ ('XX',)
+ actual:
+-(u'',)'''
++(u'',)
++
++While comparing [5][1]: 'XX' (expected) != u'' (actual)'''
+         compare(expected, actual=str(s.raised))
similarity index 51%
rename from dev-python/xlutils/xlutils-2.0.0.ebuild
rename to dev-python/xlutils/xlutils-2.0.0-r1.ebuild
index d701317d10246c438c20b027556a133dba3bcb2e..1da8b0f0d4bc3d11c3c54bd0fdde637d5de38ea8 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
 
 inherit distutils-r1
 
@@ -18,18 +18,25 @@ LICENSE="MIT"
 SLOT="0"
 
 RDEPEND="
-       dev-python/xlwt[${PYTHON_USEDEP}]
-       dev-python/xlrd[${PYTHON_USEDEP}]"
+       >=dev-python/xlwt-1.3[${PYTHON_USEDEP}]
+       >=dev-python/xlrd-1.2[${PYTHON_USEDEP}]"
 
 DEPEND="${RDEPEND}
        test? (
-               dev-python/errorhandler[${PYTHON_USEDEP}]
-               dev-python/manuel[${PYTHON_USEDEP}]
+               >=dev-python/errorhandler-2[${PYTHON_USEDEP}]
+               >=dev-python/manuel-1.9[${PYTHON_USEDEP}]
                dev-python/mock[${PYTHON_USEDEP}]
+               dev-python/nose[${PYTHON_USEDEP}]
                dev-python/pytest[${PYTHON_USEDEP}]
                dev-python/testfixtures[${PYTHON_USEDEP}]
        )"
 
+PATCHES=(
+       "${FILESDIR}/${PN}-2.0.0-fix-tests.patch"
+)
+
 python_test() {
-       py.test -v xlutils/tests || die "Tests fail with ${EPYTHON}"
+       # upstream runs its tests with nose, but the suite actually runs better
+       # when ran through pytest...
+       pytest -vv || die "Tests fail with ${EPYTHON}"
 }