From 25b1b4f492f813c6c92a8c10bdbe73662f3edb1b Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 8 May 2019 10:40:02 -0400 Subject: [PATCH] dev-python/xlutils: add py3 compat Also, fix tests. Closes: https://bugs.gentoo.org/655826 Closes: https://bugs.gentoo.org/663412 Signed-off-by: Virgil Dupras Package-Manager: Portage-2.3.62, Repoman-2.3.11 --- .../files/xlutils-2.0.0-fix-tests.patch | 23 +++++++++++++++++++ ...s-2.0.0.ebuild => xlutils-2.0.0-r1.ebuild} | 23 ++++++++++++------- 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch rename dev-python/xlutils/{xlutils-2.0.0.ebuild => xlutils-2.0.0-r1.ebuild} (51%) 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 index 000000000000..b7e74925095e --- /dev/null +++ b/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch @@ -0,0 +1,23 @@ +From e9edf279ba2e699be92da7611368cf92b4d87cec Mon Sep 17 00:00:00 2001 +From: Chris Withers +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)) diff --git a/dev-python/xlutils/xlutils-2.0.0.ebuild b/dev-python/xlutils/xlutils-2.0.0-r1.ebuild 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 d701317d1024..1da8b0f0d4bc 100644 --- a/dev-python/xlutils/xlutils-2.0.0.ebuild +++ b/dev-python/xlutils/xlutils-2.0.0-r1.ebuild @@ -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}" } -- 2.26.2