commit:     e6bd20e91370b305de7765965d657742785855fc
Author:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 19 10:01:31 2015 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Wed Aug 19 10:05:32 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6bd20e9

dev-python/rdflib: add -test.patch

fixes upstream https://github.com/RDFLib/rdflib/issues/396

Package-Manager: portage-2.2.20

 dev-python/rdflib/files/rdflib-4-test.patch | 41 +++++++++++++++++++++++++++++
 dev-python/rdflib/rdflib-4.1.2.ebuild       | 11 +++-----
 dev-python/rdflib/rdflib-4.2.0.ebuild       | 10 +++----
 3 files changed, 47 insertions(+), 15 deletions(-)

diff --git a/dev-python/rdflib/files/rdflib-4-test.patch 
b/dev-python/rdflib/files/rdflib-4-test.patch
new file mode 100644
index 0000000..e79e3ff
--- /dev/null
+++ b/dev-python/rdflib/files/rdflib-4-test.patch
@@ -0,0 +1,41 @@
+https://github.com/joernhees/rdflib/commit/36335d5d178ffbcc0422b8b8ee7444893a30ed84
+diff --git a/test/test_issue375.py b/test/test_issue375.py
+index 29726b9..17f168b 100644
+--- a/test/test_issue375.py
++++ b/test/test_issue375.py
+@@ -1,4 +1,6 @@
++import os
+ import subprocess
++import sys
+ import re
+ 
+ rdfa_expected = u'''@prefix dc: <http://purl.org/dc/terms/> .
+@@ -146,6 +148,9 @@
+     rdfa:usesVocabulary schema: .
+ '''.strip()
+ 
++env = os.environ.copy()
++env['PYTHONPATH'] = '.:' + env.get('PYTHONPATH', '')
++
+ def test_rdfpipe_bytes_vs_str():
+     """
+     Issue 375: rdfpipe command generates bytes vs. str TypeError
+@@ -155,7 +160,7 @@ def test_rdfpipe_bytes_vs_str():
+     rdfpipe to ensure that we get the expected results.
+     """
+     args = ['python', 'rdflib/tools/rdfpipe.py', '-i', 'rdfa1.1', 
'test/rdfa/oreilly.html']
+-    proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
universal_newlines=True)
++    proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
universal_newlines=True, env=env)
+     res = ''
+     while proc.poll() is None:
+         res += proc.stdout.read()
+@@ -170,7 +175,7 @@ def test_rdfpipe_mdata_open():
+     the open() builtin instead.
+     """
+     args = ['python', 'rdflib/tools/rdfpipe.py', '-i', 'mdata', 
'test/mdata/codelab.html']
+-    proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
universal_newlines=True)
++    proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
universal_newlines=True, env=env)
+     res = ''
+     while proc.poll() is None:
+         res += proc.stdout.read()
+

diff --git a/dev-python/rdflib/rdflib-4.1.2.ebuild 
b/dev-python/rdflib/rdflib-4.1.2.ebuild
index ea599e2..72974e6 100644
--- a/dev-python/rdflib/rdflib-4.1.2.ebuild
+++ b/dev-python/rdflib/rdflib-4.1.2.ebuild
@@ -1,4 +1,3 @@
-
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
@@ -34,6 +33,8 @@ DEPEND="${RDEPEND}
        test? ( dev-python/sparql-wrapper[${PYTHON_USEDEP}]
                >=dev-python/nose-1.3.1-r1[${PYTHON_USEDEP}] )"
 
+PATCHES=( "${FILESDIR}"/${PN}-4-test.patch )
+
 python_prepare_all() {
        # Upstream manufactured .pyc files which promptly break distutils' 
src_test
        find -name "*.py[oc~]" -delete || die
@@ -46,15 +47,9 @@ python_prepare_all() {
 }
 
 python_test() {
+       # the default; nose with: --where=./ does not work for python3
        if python_is_python3; then
                pushd "${BUILD_DIR}/src/" > /dev/null
-               if [[ "${EPYTHON}" == 'python3.4' ]]; then
-                       sed -e 's:test_rdfpipe_bytes_vs_str:_&:' \
-                               -e 's:test_rdfpipe_mdata_open:_&:' \
-                               -i test/test_issue375.py || die
-                       sed -e 's:testHTML:_&:' \
-                               -i test/test_xmlliterals.py || die
-               fi
                "${PYTHON}" ./run_tests.py || die "Tests failed under 
${EPYTHON}"
                popd > /dev/null
        else

diff --git a/dev-python/rdflib/rdflib-4.2.0.ebuild 
b/dev-python/rdflib/rdflib-4.2.0.ebuild
index 294c0a5..88878be 100644
--- a/dev-python/rdflib/rdflib-4.2.0.ebuild
+++ b/dev-python/rdflib/rdflib-4.2.0.ebuild
@@ -33,6 +33,8 @@ DEPEND="${RDEPEND}
        test? ( dev-python/sparql-wrapper[${PYTHON_USEDEP}]
                >=dev-python/nose-1.3.1-r1[${PYTHON_USEDEP}] )"
 
+PATCHES=( "${FILESDIR}"/${PN}-4-test.patch )
+
 python_prepare_all() {
        # Upstream manufactured .pyc files which promptly break distutils' 
src_test
        find -name "*.py[oc~]" -delete || die
@@ -45,15 +47,9 @@ python_prepare_all() {
 }
 
 python_test() {
+       # the default; nose with: --where=./ does not work for python3
        if python_is_python3; then
                pushd "${BUILD_DIR}/src/" > /dev/null
-               if [[ "${EPYTHON}" == 'python3.4' ]]; then
-                       sed -e 's:test_rdfpipe_bytes_vs_str:_&:' \
-                               -e 's:test_rdfpipe_mdata_open:_&:' \
-                               -i test/test_issue375.py || die
-                       sed -e 's:testHTML:_&:' \
-                               -i test/test_xmlliterals.py || die
-               fi
                "${PYTHON}" ./run_tests.py || die "Tests failed under 
${EPYTHON}"
                popd > /dev/null
        else

Reply via email to