Skip to contentSkip to conversation

python-jsonschema: multiple fixes

PATCH Superseded Nicola Lunghi 2 participants 4 messages Nov 14, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python-jsonschema: multiple fixes

- remove extra space in python-jsonschema_3.1.1.bb
- add second license file to LIC_FILES_CHKSUM for json module
- add missing dependencies: six, datetime, importlib-metadata
- add HOMEPAGE field

Also:
- add RDEPENDS for PACKAGECONFIG[format] for optional modules that are not always needed. In particular rfc3987 and strict-rfc3339 are GPLv3 modules.
- add missing idna and jsonpointer modules for PACKAGECONFIG[format]

---
 .../python/python-jsonschema.inc              | 20 +++++++++++++++----
 .../python/python-jsonschema_3.1.1.bb         |  2 +-
 2 files changed, 17 insertions(+), 5 deletions(-)
meta-python/recipes-devtools/python/python-jsonschema.inc +16 -4
index d9ccf1cad..df41f06a2 100644
@@ -1,15 +1,28 @@
 SUMMARY = "An implementation of JSON Schema validation for Python"
+HOMEPAGE = "https://github.com/Julian/jsonschema"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \
+                    file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af"
+DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
+PR = "r1"
 
 SRC_URI[md5sum] = "a802ab85600074a726ef6acc4e6a8148"
 SRC_URI[sha256sum] = "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
 
-DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
+PACKAGECONFIG ??= "format"
+PACKAGECONFIG[format] = ",,,\
+    ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-jsonpointer \
+    ${PYTHON_PN}-webcolors \
+    ${PYTHON_PN}-rfc3987 \
+    ${PYTHON_PN}-strict-rfc3339 \
+"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-attrs \
     ${PYTHON_PN}-core \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-importlib-metadata \
     ${PYTHON_PN}-io \
     ${PYTHON_PN}-json \
     ${PYTHON_PN}-netclient \
@@ -17,9 +30,8 @@ RDEPENDS_${PN} += " \
     ${PYTHON_PN}-pkgutil \
     ${PYTHON_PN}-pprint \
     ${PYTHON_PN}-pyrsistent \
-    ${PYTHON_PN}-rfc3987 \
     ${PYTHON_PN}-shell \
-    ${PYTHON_PN}-strict-rfc3339 \
+    ${PYTHON_PN}-six \
     ${PYTHON_PN}-unittest \
     ${PYTHON_PN}-setuptools-scm \
 "
meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb +1 -1
index b677c646e..13ed45384 100644
@@ -8,5 +8,5 @@ RDEPENDS_${PN} += " \
     ${PYTHON_PN}-lang \
     ${PYTHON_PN}-re \
     ${PYTHON_PN}-subprocess \
-    ${PYTHON_PN}-textutils \ 
+    ${PYTHON_PN}-textutils \
 "
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 python-jsonschema: add PACKAGECONFIG format_nongpl

This is the backport of a patch upstream
- 10f8a3e Add format validators as separate modules

that add an option permit to use validator that don't contain GPLv3 code.

---
 .../python/python-jsonschema.inc              | 12 +++
 ...-setup.cfg-add-non-GPL-format-option.patch | 96 +++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch
meta-python/recipes-devtools/python/python-jsonschema.inc +12 -0
index df41f06a2..9b81b7ad4 100644
@@ -6,10 +6,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \
 DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
 PR = "r1"
 
+FILESEXTRAPATHS_prepend := "${THISDIR}/python-jsonschema:"
+
+SRC_URI_append = " file://0001-setup.cfg-add-non-GPL-format-option.patch"
+
 SRC_URI[md5sum] = "a802ab85600074a726ef6acc4e6a8148"
 SRC_URI[sha256sum] = "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
 
 PACKAGECONFIG ??= "format"
+# PACKAGECONFIG ??= "format_nongpl"
 PACKAGECONFIG[format] = ",,,\
     ${PYTHON_PN}-idna \
     ${PYTHON_PN}-jsonpointer \
@@ -17,6 +22,13 @@ PACKAGECONFIG[format] = ",,,\
     ${PYTHON_PN}-rfc3987 \
     ${PYTHON_PN}-strict-rfc3339 \
 "
+PACKAGECONFIG[format_nongpl] = ",,,\
+    ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-jsonpointer \
+    ${PYTHON_PN}-webcolors \
+    ${PYTHON_PN}-rfc3986-validator \
+    ${PYTHON_PN}-rfc3339-validator \
+"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-attrs \
meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch new file +96 -0

96 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

Re: [meta-python][PATCH 2/2] python-jsonschema: add PACKAGECONFIG format_nongpl

Quoted 34 lines · Nicola Lunghi

This is the backport of a patch upstream
- 10f8a3e Add format validators as separate modules

that add an option permit to use validator that don't contain GPLv3 code.

---
 .../python/python-jsonschema.inc              | 12 +++
 ...-setup.cfg-add-non-GPL-format-option.patch | 96 +++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch
meta-python/recipes-devtools/python/python-jsonschema.inc +5 -0
index df41f06a2..9b81b7ad4 100644
@@ -6,10 +6,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \
 DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
 PR = "r1"
 
+FILESEXTRAPATHS_prepend := "${THISDIR}/python-jsonschema:"
+
+SRC_URI_append = " file://0001-setup.cfg-add-non-GPL-format-option.patch"
+
 SRC_URI[md5sum] = "a802ab85600074a726ef6acc4e6a8148"
 SRC_URI[sha256sum] = "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
 
 PACKAGECONFIG ??= "format"
+# PACKAGECONFIG ??= "format_nongpl"
 PACKAGECONFIG[format] = ",,,\
     ${PYTHON_PN}-idna \
     ${PYTHON_PN}-jsonpointer \

meta-python/recipes-devtools/python/python-jsonschema.inc PACKAGECONFIG[format] = ",,,\ · line 25

Quoted 4 lines
meta-python/recipes-devtools/python/python-jsonschema.inc +1 -0
@@ -17,6 +22,13 @@ PACKAGECONFIG[format] = ",,,\
     ${PYTHON_PN}-rfc3987 \
     ${PYTHON_PN}-strict-rfc3339 \
 "
+PACKAGECONFIG[format_nongpl] = ",,,\

perhaps call it nongpl ( avoid underscores if you can )

Quoted 20 lines
meta-python/recipes-devtools/python/python-jsonschema.inc +6 -0
+    ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-jsonpointer \
+    ${PYTHON_PN}-webcolors \
+    ${PYTHON_PN}-rfc3986-validator \
+    ${PYTHON_PN}-rfc3339-validator \
+"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-attrs \
meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch new file +5 -0
new file mode 100644
index 000000000..96fd48447
@@ -0,0 +1,96 @@
+From 8df0332475991884b8e1801d31f9c3e06d06bf9f Mon Sep 17 00:00:00 2001
+From: Nicola Lunghi <[email protected]>
+Date: Thu, 14 Nov 2019 18:58:56 +0000
+Subject: [PATCH] setup.cfg: add non GPL format option
+

meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch line 15

Quoted 10 lines
meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch new file +10 -0
+This is a rewrite of the following upstream commits:
+
+ - 10f8a3e Add format validators as separate modules
+ - af37707 non GPL format option
+
+removing all the non necessary bits (tox in particular)
+
+Original author: Nicolas Aimetti <[email protected]>
+
+Upstream-status: Invalid.

what does invalid state here? Perhaps inapproprite is what you meant ?

Quoted 89 lines
meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch new file +81 -1
+---
+ jsonschema/_format.py | 33 ++++++++++++++++++++++++++++-----
+ setup.cfg             |  6 ++++++
+ 2 files changed, 34 insertions(+), 5 deletions(-)
+
+diff --git a/jsonschema/_format.py b/jsonschema/_format.py
+index aa04090..c967d98 100644
+--- a/jsonschema/_format.py
++++ b/jsonschema/_format.py
+@@ -248,7 +248,26 @@ else:
+ try:
+     import rfc3987
+ except ImportError:
+-    pass
++    try:
++        from rfc3986_validator import validate_rfc3986
++    except ImportError:
++        pass
++    else:
++        @_checks_drafts(name="uri",)
++        def is_uri(instance):
++            if not isinstance(instance, str_types):
++                return True
++            return validate_rfc3986(instance, rule="URI")
++
++        @_checks_drafts(
++            draft6="uri-reference",
++            draft7="uri-reference",
++            raises=ValueError,
++        )
++        def is_uri_reference(instance):
++            if not isinstance(instance, str_types):
++                return True
++            return validate_rfc3986(instance, rule="URI_reference")
+ else:
+     @_checks_drafts(draft7="iri", raises=ValueError)
+     def is_iri(instance):
+@@ -280,15 +299,19 @@ else:
+
+
+ try:
+-    import strict_rfc3339
++    from strict_rfc3339 import validate_rfc3339
+ except ImportError:
+-    pass
+-else:
++    try:
++        from rfc3339_validator import validate_rfc3339
++    except ImportError:
++        validate_rfc3339 = None
++
++if validate_rfc3339:
+     @_checks_drafts(name="date-time")
+     def is_datetime(instance):
+         if not isinstance(instance, str_types):
+             return True
+-        return strict_rfc3339.validate_rfc3339(instance)
++        return validate_rfc3339(instance)
+
+     @_checks_drafts(draft7="time")
+     def is_time(instance):
+diff --git a/setup.cfg b/setup.cfg
+index 74bc4a7..878221c 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -40,6 +40,12 @@ format =
+       rfc3987
+       strict-rfc3339
+       webcolors
++format_nongpl =
++      idna
++      jsonpointer>1.13
++      webcolors
++      rfc3986-validator>0.1.0
++      rfc3339-validator
+
+ [options.entry_points]
+ console_scripts =
+--
+2.20.1
+
--

2.20.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#3 lore raw
In reply to Nicola Lunghi
Quoted 23 lines · Nicola Lunghi

- remove extra space in python-jsonschema_3.1.1.bb
- add second license file to LIC_FILES_CHKSUM for json module
- add missing dependencies: six, datetime, importlib-metadata
- add HOMEPAGE field

Also:
- add RDEPENDS for PACKAGECONFIG[format] for optional modules that are not always needed. In particular rfc3987 and strict-rfc3339 are GPLv3 modules.
- add missing idna and jsonpointer modules for PACKAGECONFIG[format]

---
 .../python/python-jsonschema.inc              | 20 +++++++++++++++----
 .../python/python-jsonschema_3.1.1.bb         |  2 +-
 2 files changed, 17 insertions(+), 5 deletions(-)
meta-python/recipes-devtools/python/python-jsonschema.inc +0 -0
index d9ccf1cad..df41f06a2 100644

meta-python/recipes-devtools/python/python-jsonschema.inc line 7

Quoted 8 lines
meta-python/recipes-devtools/python/python-jsonschema.inc +5 -1
@@ -1,15 +1,28 @@
 SUMMARY = "An implementation of JSON Schema validation for Python"
+HOMEPAGE = "https://github.com/Julian/jsonschema"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8 \
+                    file://json/LICENSE;md5=9d4de43111d33570c8fe49b4cb0e01af"
+DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
+PR = "r1"

drop PR, pr server takes care of it now a days.

Quoted 38 lines
meta-python/recipes-devtools/python/python-jsonschema.inc +11 -3
 SRC_URI[md5sum] = "a802ab85600074a726ef6acc4e6a8148"
 SRC_URI[sha256sum] = "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f"
 
-DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native"
+PACKAGECONFIG ??= "format"
+PACKAGECONFIG[format] = ",,,\
+    ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-jsonpointer \
+    ${PYTHON_PN}-webcolors \
+    ${PYTHON_PN}-rfc3987 \
+    ${PYTHON_PN}-strict-rfc3339 \
+"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-attrs \
     ${PYTHON_PN}-core \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-importlib-metadata \
     ${PYTHON_PN}-io \
     ${PYTHON_PN}-json \
     ${PYTHON_PN}-netclient \
@@ -17,9 +30,8 @@ RDEPENDS_${PN} += " \
     ${PYTHON_PN}-pkgutil \
     ${PYTHON_PN}-pprint \
     ${PYTHON_PN}-pyrsistent \
-    ${PYTHON_PN}-rfc3987 \
     ${PYTHON_PN}-shell \
-    ${PYTHON_PN}-strict-rfc3339 \
+    ${PYTHON_PN}-six \
     ${PYTHON_PN}-unittest \
     ${PYTHON_PN}-setuptools-scm \
 "
meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb +0 -0
index b677c646e..13ed45384 100644

meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb RDEPENDS_${PN} += " \ · line 11

Quoted 5 lines
meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb +1 -1
@@ -8,5 +8,5 @@ RDEPENDS_${PN} += " \
     ${PYTHON_PN}-lang \
     ${PYTHON_PN}-re \
     ${PYTHON_PN}-subprocess \
-    ${PYTHON_PN}-textutils \
+    ${PYTHON_PN}-textutils \

this change seems not relevant.

Quoted 9 lines
meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb +0 -1
 "
--

2.20.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel