summaryrefslogtreecommitdiff
path: root/dev-python/rdflib
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/rdflib
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/rdflib')
-rw-r--r--dev-python/rdflib/Manifest2
-rw-r--r--dev-python/rdflib/files/rdflib-4.2.2-python3.7-StopIteration.patch72
-rw-r--r--dev-python/rdflib/metadata.xml17
-rw-r--r--dev-python/rdflib/rdflib-4.2.2-r1.ebuild93
-rw-r--r--dev-python/rdflib/rdflib-5.0.0.ebuild48
5 files changed, 232 insertions, 0 deletions
diff --git a/dev-python/rdflib/Manifest b/dev-python/rdflib/Manifest
new file mode 100644
index 000000000000..a905e6351648
--- /dev/null
+++ b/dev-python/rdflib/Manifest
@@ -0,0 +1,2 @@
+DIST rdflib-4.2.2.tar.gz 905094 BLAKE2B fe17b5752f67c745bfdf4a160c2f5d49da19f0d85b6eddc4a65fa0ddb660de8bcc19c3ccecf893fb67f725b973cb94481374d9ee0c82072416a93e44952dba9b SHA512 efc24d8ce1080e59950cecc9c779ae0d63673c8690f74db1772f6c2dbf24d6f4de5214d5870a074bffe549b42d8d5f5d131df29bbfd174b763ae1f843aec7d5c
+DIST rdflib-5.0.0.tar.gz 818586 BLAKE2B d0046590b00211ccb4f0f586dc829c061a5f426b1cefed44a63d21d46396354b9012dbe0a63c8f9de138b25ca7d73ba624c49da6fb305ececd983c62c917fd8a SHA512 ba98ab6a7bb9d993d11c559a739761f297282eb9307f3e333db8dd1c6b365b408a59b701d823bef9be774a59b3f44f64c9444e3bb0115c0c549cb00945385dab
diff --git a/dev-python/rdflib/files/rdflib-4.2.2-python3.7-StopIteration.patch b/dev-python/rdflib/files/rdflib-4.2.2-python3.7-StopIteration.patch
new file mode 100644
index 000000000000..389d220dc1b7
--- /dev/null
+++ b/dev-python/rdflib/files/rdflib-4.2.2-python3.7-StopIteration.patch
@@ -0,0 +1,72 @@
+Traceback (most recent call last):
+ File "/var/tmp/portage/dev-python/rdflib-4.2.2/work/rdflib-4.2.2-python3_7/build/src/rdflib/plugins/sparql/evaluate.py", line 330, in evalSlice
+ next(res)
+StopIteration
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+ File "/usr/lib/python3.7/site-packages/nose/case.py", line 197, in runTest
+ self.test(*self.arg)
+ File "/var/tmp/portage/dev-python/rdflib-4.2.2/work/rdflib-4.2.2-python3_7/build/src/test/test_dawg.py", line 434, in query_test
+ set(res2)
+ File "/var/tmp/portage/dev-python/rdflib-4.2.2/work/rdflib-4.2.2-python3_7/build/src/rdflib/query.py", line 258, in __iter__
+ for b in self._genbindings:
+RuntimeError: generator raised StopIteration
+
+Patch backported from
+https://github.com/RDFLib/rdflib/commit/58c45d6f30af88a22f60edcb9a459648a885e226
+
+--- a/rdflib/plugins/sparql/evaluate.py
++++ b/rdflib/plugins/sparql/evaluate.py
+@@ -15,6 +15,7 @@
+ """
+
+ import collections
++import itertools
+
+ from rdflib import Variable, Graph, BNode, URIRef, Literal
+
+@@ -323,22 +324,9 @@
+
+
+ def evalSlice(ctx, slice):
+- # import pdb; pdb.set_trace()
+ res = evalPart(ctx, slice.p)
+- i = 0
+- while i < slice.start:
+- res.next()
+- i += 1
+- i = 0
+- for x in res:
+- i += 1
+- if slice.length is None:
+- yield x
+- else:
+- if i <= slice.length:
+- yield x
+- else:
+- break
++
++ return itertools.islice(res, slice.start, slice.start+slice.length if slice.length is not None else None)
+
+
+ def evalReduced(ctx, part):
+--- a/rdflib/query.py
++++ b/rdflib/query.py
+@@ -1,5 +1,6 @@
+
+ import os
++import itertools
+ import shutil
+ import tempfile
+ import warnings
+@@ -181,7 +182,7 @@
+ return self._bindings
+
+ def _set_bindings(self, b):
+- if isinstance(b, types.GeneratorType):
++ if isinstance(b, (types.GeneratorType, itertools.islice)):
+ self._genbindings = b
+ self._bindings = []
+ else:
diff --git a/dev-python/rdflib/metadata.xml b/dev-python/rdflib/metadata.xml
new file mode 100644
index 000000000000..452c91dfbeb1
--- /dev/null
+++ b/dev-python/rdflib/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches/>
+ <use>
+ <flag name="redland">enable support for Redland triplestore</flag>
+ </use>
+ <upstream>
+ <remote-id type="pypi">rdflib</remote-id>
+ <remote-id type="github">RDFLib/rdflib</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
diff --git a/dev-python/rdflib/rdflib-4.2.2-r1.ebuild b/dev-python/rdflib/rdflib-4.2.2-r1.ebuild
new file mode 100644
index 000000000000..a6eb50c7d38a
--- /dev/null
+++ b/dev-python/rdflib/rdflib-4.2.2-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{6..9} )
+PYTHON_REQ_USE="sqlite?,threads(+)"
+
+# The usual required for tests
+DISTUTILS_IN_SOURCE_BUILD=1
+
+inherit distutils-r1
+
+DESCRIPTION="RDF library containing a triple store and parser/serializer"
+HOMEPAGE="https://github.com/RDFLib/rdflib https://pypi.org/project/rdflib/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+IUSE="doc berkdb examples redland sqlite test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-python/isodate[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ berkdb? ( dev-python/bsddb3[${PYTHON_USEDEP}] )
+ redland? ( dev-libs/redland-bindings[python,${PYTHON_USEDEP}] )"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? (
+ dev-python/sparql-wrapper[${PYTHON_USEDEP}]
+ >=dev-python/nose-1.3.1-r1[${PYTHON_USEDEP}]
+ )"
+
+PATCHES=(
+ # Python 3.7 StopIteration bug
+ "${FILESDIR}"/${PN}-4.2.2-python3.7-StopIteration.patch
+)
+
+python_prepare_all() {
+ # Upstream manufactured .pyc files which promptly break distutils' src_test
+ find -name "*.py[oc~]" -delete || die
+
+ # Bug 358189; take out tests that attempt to connect to the network
+ sed -e "/'--with-doctest',/d" -e "/'--doctest-extension=.doctest',/d" \
+ -e "/'--doctest-tests',/d" -i run_tests.py || die
+
+ sed -e "s: 'sphinx.ext.intersphinx',::" -i docs/conf.py || die
+
+ # doc build requires examples folder at the upper level of docs
+ if use doc; then
+ cd docs || die
+ ln -sf ../examples . || die
+ cd ../ || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ # https://github.com/RDFLib/rdflib/issues/510
+ if use doc; then
+ einfo ""
+ einfo "Several warnings and Errors present in the build"
+ einfo "For a complete build, it is required to install"
+ einfo "github.com/gjhiggins/n3_pygments_lexer and"
+ einfo "github.com/gjhiggins/sparql_pygments_lexer"
+ einfo "outside portage via pip or by cloning. These have not been"
+ einfo "given a tagged release by the author and are not in portage"
+ einfo ""
+
+ emake -C docs html
+ HTML_DOCS=( docs/_build/html/. )
+ fi
+}
+
+python_test() {
+ pushd "${BUILD_DIR}/src/" >/dev/null || die
+ "${EPYTHON}" ./run_tests.py -v || die "Tests failed under ${EPYTHON}"
+ popd >/dev/null || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use examples; then
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
diff --git a/dev-python/rdflib/rdflib-5.0.0.ebuild b/dev-python/rdflib/rdflib-5.0.0.ebuild
new file mode 100644
index 000000000000..ee3a9c338a1e
--- /dev/null
+++ b/dev-python/rdflib/rdflib-5.0.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{6..9} )
+PYTHON_REQ_USE="sqlite?,threads(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="RDF library containing a triple store and parser/serializer"
+HOMEPAGE="https://github.com/RDFLib/rdflib https://pypi.org/project/rdflib/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="berkdb examples sqlite"
+
+RDEPEND="
+ dev-python/isodate[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ berkdb? ( dev-python/bsddb3[${PYTHON_USEDEP}] )"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/requests[${PYTHON_USEDEP}]
+ )"
+
+distutils_enable_tests nose
+
+python_prepare_all() {
+ # these tests require internet access
+ sed -i -e '/doctest/d' setup.cfg || die
+ rm test/test_sparql_service.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use examples; then
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}