summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgetzze2021-09-13 13:15:36 +0100
committergetzze2021-09-13 13:15:36 +0100
commit06d9f329567b77bd61632718282093c9ae2771dd (patch)
treeb978524ca7c0814dde7122f5e367e6555d47762d
parent70c8dd8fe24baa745fe10e837b9e0ebeee499be2 (diff)
downloadaur-06d9f329567b77bd61632718282093c9ae2771dd.tar.gz
update to 2.0.3
-rw-r--r--.SRCINFO20
-rw-r--r--0001-Fixed-remote-frame-context-handling.patch253
-rw-r--r--PKGBUILD39
3 files changed, 14 insertions, 298 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2481b854275..9a5d8b893c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,12 @@
pkgbase = python-pyld
- pkgdesc = An implementation of the JSON-LD specification in Python
- pkgver = 1.0.5
- pkgrel = 3
+ pkgdesc = JSON-LD processor written in Python
+ pkgver = 2.0.3
+ pkgrel = 1
url = https://github.com/digitalbazaar/pyld
arch = any
license = BSD
- makedepends = python-setuptools
- makedepends = python2-setuptools
- source = https://github.com/digitalbazaar/pyld/archive/1.0.5.tar.gz
- source = 0001-Fixed-remote-frame-context-handling.patch
- sha512sums = a673d953be990fde98a3b32e879e1b7941afc9d3082be6400f69223deee226047e05b0ce68bdf05844cb7e8e3142f731f7c4891b6a4986413518dbdaa2da779c
- sha512sums = d0b15814c2fe315ad3dddda8ea452229a172be060d7074b6d99ec9eaed857f2e6b715e760cbcc194f9c8a679bc929ac652df847377c6e8b4944bf77795432f19
-
-pkgname = python-pyld
depends = python-setuptools
+ source = https://github.com/digitalbazaar/pyld/archive/2.0.3.tar.gz
+ sha512sums = ec12274cf7b6b6842c054e7c78a74a36d60496377d329c821a930dcf2000a02f24b77263d20086cdd83d28c1be37ab0b0c785026c7b3bf44cc1a42597410e769
-pkgname = python2-pyld
- depends = python2-setuptools
-
+pkgname = python-pyld
diff --git a/0001-Fixed-remote-frame-context-handling.patch b/0001-Fixed-remote-frame-context-handling.patch
deleted file mode 100644
index e5368df3e8b..00000000000
--- a/0001-Fixed-remote-frame-context-handling.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-From a87843cca026e82fe2779d7176c6be3a6e4c9478 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C5=81ukasz=20Jancewicz?= <lj@rdprojekt.pl>
-Date: Thu, 24 Jul 2014 16:11:10 +0200
-Subject: [PATCH 1/2] Fixed remote frame context handling.
-
-Added unit-tests to cover this scenario.
----
- lib/pyld/jsonld.py | 9 ++-
- tests/unit-tests.py | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 206 insertions(+), 5 deletions(-)
- create mode 100644 tests/unit-tests.py
-
-diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
-index b9eecaa..0aa8ef1 100644
---- a/lib/pyld/jsonld.py
-+++ b/lib/pyld/jsonld.py
-@@ -832,11 +832,11 @@ class JsonLdProcessor:
- if frame is not None:
- ctx = frame.get('@context', {})
- if remote_frame['contextUrl'] is not None:
-- if ctx is not None:
-- ctx = remote_frame['contextUrl']
-- else:
-+ if ctx:
- ctx = JsonLdProcessor.arrayify(ctx)
- ctx.append(remote_frame['contextUrl'])
-+ else:
-+ ctx = remote_frame['contextUrl']
- frame['@context'] = ctx
-
- try:
-@@ -1036,8 +1036,7 @@ class JsonLdProcessor:
-
- # retrieve URLs in local_ctx
- local_ctx = copy.deepcopy(local_ctx)
-- if (_is_string(local_ctx) or (
-- _is_object(local_ctx) and '@context' not in local_ctx)):
-+ if not (_is_object(local_ctx) and '@context' in local_ctx):
- local_ctx = {'@context': local_ctx}
- try:
- self._retrieve_context_urls(
-diff --git a/tests/unit-tests.py b/tests/unit-tests.py
-new file mode 100644
-index 0000000..3248b20
---- /dev/null
-+++ b/tests/unit-tests.py
-@@ -0,0 +1,202 @@
-+import json
-+import unittest
-+
-+from pyld import jsonld
-+
-+# Inputs and outputs used here are essentially modified documents
-+# of JSON-LD frame-0001 test.
-+
-+FRAME_0001_IN = '''{
-+ "@context": {
-+ "dc": "http://purl.org/dc/elements/1.1/",
-+ "ex": "http://example.org/vocab#",
-+ "ex:contains": {"@type": "@id"}
-+ },
-+ "@graph": [
-+ {
-+ "@id": "http://example.org/test/#library",
-+ "@type": "ex:Library",
-+ "ex:contains": "http://example.org/test#book"
-+ },
-+ {
-+ "@id": "http://example.org/test#book",
-+ "@type": "ex:Book",
-+ "dc:contributor": "Writer",
-+ "dc:title": "My Book",
-+ "ex:contains": "http://example.org/test#chapter"
-+ },
-+ {
-+ "@id": "http://example.org/test#chapter",
-+ "@type": "ex:Chapter",
-+ "dc:description": "Fun",
-+ "dc:title": "Chapter One"
-+ }
-+ ]
-+}'''
-+
-+
-+FRAME_0001_FRAME = '''{
-+ "@context": {
-+ "dc": "http://purl.org/dc/elements/1.1/",
-+ "ex": "http://example.org/vocab#"
-+ },
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@type": "ex:Book",
-+ "ex:contains": {
-+ "@type": "ex:Chapter"
-+ }
-+ }
-+}'''
-+
-+FRAME_0001_FRAME_WITHOUT_CONTEXT = '''{
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@type": "ex:Book",
-+ "ex:contains": {
-+ "@type": "ex:Chapter"
-+ }
-+ }
-+}'''
-+
-+FRAME_0001_FRAME_WITH_PARTIAL_CONTEXT = '''{
-+ "@context": {
-+ "dc": "http://purl.org/dc/elements/1.1/"
-+ },
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@type": "ex:Book",
-+ "ex:contains": {
-+ "@type": "ex:Chapter"
-+ }
-+ }
-+}'''
-+
-+FRAME_0001_FRAME_CONTEXT = '''{
-+ "@context": {
-+ "dc": "http://purl.org/dc/elements/1.1/",
-+ "ex": "http://example.org/vocab#"
-+ }
-+}'''
-+
-+FRAME_0001_FRAME_PARTIAL_CONTEXT = '''{
-+ "@context": {
-+ "ex": "http://example.org/vocab#"
-+ }
-+}'''
-+
-+FRAME_0001_OUT_WITH_REMOTE_CONTEXT = '''{
-+ "@context": "http://example.com/frame-context.json",
-+ "@graph": [{
-+ "@id": "http://example.org/test/#library",
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#book",
-+ "@type": "ex:Book",
-+ "dc:contributor": "Writer",
-+ "dc:title": "My Book",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#chapter",
-+ "@type": "ex:Chapter",
-+ "dc:description": "Fun",
-+ "dc:title": "Chapter One"
-+ }
-+ }
-+ }]
-+}'''
-+
-+FRAME_0001_OUT_WITH_LOCAL_AND_REMOTE_CONTEXT = '''{
-+ "@context": [{
-+ "dc": "http://purl.org/dc/elements/1.1/",
-+ "ex": "http://example.org/vocab#"
-+ }, "http://example.com/frame-context.json"],
-+ "@graph": [{
-+ "@id": "http://example.org/test/#library",
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#book",
-+ "@type": "ex:Book",
-+ "dc:contributor": "Writer",
-+ "dc:title": "My Book",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#chapter",
-+ "@type": "ex:Chapter",
-+ "dc:description": "Fun",
-+ "dc:title": "Chapter One"
-+ }
-+ }
-+ }]
-+}'''
-+
-+FRAME_0001_OUT_WITH_HALF_LOCAL_AND_HALF_REMOTE_CONTEXT = '''{
-+ "@context": [{
-+ "dc": "http://purl.org/dc/elements/1.1/"
-+ }, "http://example.com/frame-context.json"],
-+ "@graph": [{
-+ "@id": "http://example.org/test/#library",
-+ "@type": "ex:Library",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#book",
-+ "@type": "ex:Book",
-+ "dc:contributor": "Writer",
-+ "dc:title": "My Book",
-+ "ex:contains": {
-+ "@id": "http://example.org/test#chapter",
-+ "@type": "ex:Chapter",
-+ "dc:description": "Fun",
-+ "dc:title": "Chapter One"
-+ }
-+ }
-+ }]
-+}'''
-+
-+
-+class TestCaseForFrame(unittest.TestCase):
-+
-+ def _test_remote_context_with(
-+ self, frame_doc, frame_context_doc, out_doc):
-+ input_ = json.loads(FRAME_0001_IN)
-+
-+ def fake_loader(url):
-+ if url == 'http://example.com/frame.json':
-+ return {
-+ 'contextUrl': 'http://example.com/frame-context.json',
-+ 'document': frame_doc,
-+ 'documentUrl': url
-+ }
-+ elif url == 'http://example.com/frame-context.json':
-+ return {
-+ 'contextUrl': None,
-+ 'document': frame_context_doc,
-+ 'documentUrl': url
-+ }
-+ else:
-+ raise Exception("Unknown URL: {}".format(url))
-+
-+ options = {
-+ 'documentLoader': fake_loader
-+ }
-+ framed = jsonld.frame(
-+ input_, 'http://example.com/frame.json', options=options)
-+
-+ self.assertEqual(framed, json.loads(out_doc))
-+
-+ def test_remote_context_local_and_remote_context_equal(self):
-+ self._test_remote_context_with(
-+ FRAME_0001_FRAME, FRAME_0001_FRAME_CONTEXT,
-+ FRAME_0001_OUT_WITH_LOCAL_AND_REMOTE_CONTEXT)
-+
-+ def test_remote_context_remote_context_only(self):
-+ self._test_remote_context_with(
-+ FRAME_0001_FRAME_WITHOUT_CONTEXT, FRAME_0001_FRAME_CONTEXT,
-+ FRAME_0001_OUT_WITH_REMOTE_CONTEXT)
-+
-+ def test_remote_context_half_context_local_and_half_remote(self):
-+ self._test_remote_context_with(
-+ FRAME_0001_FRAME_WITH_PARTIAL_CONTEXT,
-+ FRAME_0001_FRAME_PARTIAL_CONTEXT,
-+ FRAME_0001_OUT_WITH_HALF_LOCAL_AND_HALF_REMOTE_CONTEXT)
-+
-+
-+if __name__ == '__main__':
-+ unittest.main()
-\ No newline at end of file
---
-2.11.0
-
diff --git a/PKGBUILD b/PKGBUILD
index a1e6bcefd94..e8df64e9b13 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,49 +1,26 @@
# Maintainer: Sven Schneider <archlinux.sandmann@googlemail.com>
-pkgname=('python-pyld' 'python2-pyld')
+pkgname=python-pyld
_pkgname='pyld'
-pkgver=1.0.5
-pkgrel=3
-pkgdesc="An implementation of the JSON-LD specification in Python"
+pkgver=2.0.3
+pkgrel=1
+pkgdesc="JSON-LD processor written in Python"
arch=('any')
url="https://github.com/digitalbazaar/pyld"
license=('BSD')
-makedepends=('python-setuptools' 'python2-setuptools')
-source=(https://github.com/digitalbazaar/${_pkgname}/archive/${pkgver}.tar.gz
- 0001-Fixed-remote-frame-context-handling.patch)
-sha512sums=('a673d953be990fde98a3b32e879e1b7941afc9d3082be6400f69223deee226047e05b0ce68bdf05844cb7e8e3142f731f7c4891b6a4986413518dbdaa2da779c'
- 'd0b15814c2fe315ad3dddda8ea452229a172be060d7074b6d99ec9eaed857f2e6b715e760cbcc194f9c8a679bc929ac652df847377c6e8b4944bf77795432f19')
-
-prepare() {
- patch -p1 -d "${srcdir}/${_pkgname}-${pkgver}" < "${srcdir}"/0001-Fixed-remote-frame-context-handling.patch
-
- cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py2"
-}
+depends=('python-setuptools')
+source=(https://github.com/digitalbazaar/${_pkgname}/archive/${pkgver}.tar.gz)
+sha512sums=('ec12274cf7b6b6842c054e7c78a74a36d60496377d329c821a930dcf2000a02f24b77263d20086cdd83d28c1be37ab0b0c785026c7b3bf44cc1a42597410e769')
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
python setup.py build
-
- cd "${srcdir}/${_pkgname}-${pkgver}-py2"
- python2 setup.py build
}
-package_python-pyld() {
- depends=('python-setuptools')
-
+package() {
cd "${srcdir}/${_pkgname}-${pkgver}"
python3 setup.py install --root="${pkgdir}" -O1
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
-
-package_python2-pyld() {
- depends=('python2-setuptools')
-
- cd "${srcdir}/${_pkgname}-${pkgver}-py2"
-
- python2 setup.py install --root="${pkgdir}" -O1
-
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-}