diff options
-rw-r--r-- | meta-python/recipes-devtools/python/python-jsonschema.inc | 6 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch | 96 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python-jsonschema_3.2.0.bb (renamed from meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb) | 0 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-jsonschema_3.2.0.bb (renamed from meta-python/recipes-devtools/python/python3-jsonschema_3.1.1.bb) | 0 |
4 files changed, 2 insertions, 100 deletions
diff --git a/meta-python/recipes-devtools/python/python-jsonschema.inc b/meta-python/recipes-devtools/python/python-jsonschema.inc index 258beadc4..8135b0fe6 100644 --- a/meta-python/recipes-devtools/python/python-jsonschema.inc +++ b/meta-python/recipes-devtools/python/python-jsonschema.inc | |||
@@ -7,10 +7,8 @@ DEPENDS += "${PYTHON_PN}-vcversioner-native ${PYTHON_PN}-setuptools-scm-native" | |||
7 | 7 | ||
8 | FILESEXTRAPATHS_prepend := "${THISDIR}/python-jsonschema:" | 8 | FILESEXTRAPATHS_prepend := "${THISDIR}/python-jsonschema:" |
9 | 9 | ||
10 | SRC_URI_append = " file://0001-setup.cfg-add-non-GPL-format-option.patch" | 10 | SRC_URI[md5sum] = "f1a0b5011f05a02a8dee1070cd10a26d" |
11 | 11 | SRC_URI[sha256sum] = "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" | |
12 | SRC_URI[md5sum] = "a802ab85600074a726ef6acc4e6a8148" | ||
13 | SRC_URI[sha256sum] = "2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f" | ||
14 | 12 | ||
15 | PACKAGECONFIG ??= "format" | 13 | PACKAGECONFIG ??= "format" |
16 | PACKAGECONFIG[format] = ",,,\ | 14 | PACKAGECONFIG[format] = ",,,\ |
diff --git a/meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch b/meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch deleted file mode 100644 index afc38a30b..000000000 --- a/meta-python/recipes-devtools/python/python-jsonschema/0001-setup.cfg-add-non-GPL-format-option.patch +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | From 8df0332475991884b8e1801d31f9c3e06d06bf9f Mon Sep 17 00:00:00 2001 | ||
2 | From: Nicola Lunghi <nick83ola@gmail.com> | ||
3 | Date: Thu, 14 Nov 2019 18:58:56 +0000 | ||
4 | Subject: [PATCH] setup.cfg: add non GPL format option | ||
5 | |||
6 | This is a rewrite of the following upstream commits: | ||
7 | |||
8 | - 10f8a3e Add format validators as separate modules | ||
9 | - af37707 non GPL format option | ||
10 | |||
11 | removing all the non necessary bits (tox in particular) | ||
12 | |||
13 | Original author: Nicolas Aimetti <naimetti@yahoo.com.ar> | ||
14 | |||
15 | Upstream-status: Backported. [ to be removed for releases > 3.1.1 ] | ||
16 | --- | ||
17 | jsonschema/_format.py | 33 ++++++++++++++++++++++++++++----- | ||
18 | setup.cfg | 6 ++++++ | ||
19 | 2 files changed, 34 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/jsonschema/_format.py b/jsonschema/_format.py | ||
22 | index aa04090..c967d98 100644 | ||
23 | --- a/jsonschema/_format.py | ||
24 | +++ b/jsonschema/_format.py | ||
25 | @@ -248,7 +248,26 @@ else: | ||
26 | try: | ||
27 | import rfc3987 | ||
28 | except ImportError: | ||
29 | - pass | ||
30 | + try: | ||
31 | + from rfc3986_validator import validate_rfc3986 | ||
32 | + except ImportError: | ||
33 | + pass | ||
34 | + else: | ||
35 | + @_checks_drafts(name="uri",) | ||
36 | + def is_uri(instance): | ||
37 | + if not isinstance(instance, str_types): | ||
38 | + return True | ||
39 | + return validate_rfc3986(instance, rule="URI") | ||
40 | + | ||
41 | + @_checks_drafts( | ||
42 | + draft6="uri-reference", | ||
43 | + draft7="uri-reference", | ||
44 | + raises=ValueError, | ||
45 | + ) | ||
46 | + def is_uri_reference(instance): | ||
47 | + if not isinstance(instance, str_types): | ||
48 | + return True | ||
49 | + return validate_rfc3986(instance, rule="URI_reference") | ||
50 | else: | ||
51 | @_checks_drafts(draft7="iri", raises=ValueError) | ||
52 | def is_iri(instance): | ||
53 | @@ -280,15 +299,19 @@ else: | ||
54 | |||
55 | |||
56 | try: | ||
57 | - import strict_rfc3339 | ||
58 | + from strict_rfc3339 import validate_rfc3339 | ||
59 | except ImportError: | ||
60 | - pass | ||
61 | -else: | ||
62 | + try: | ||
63 | + from rfc3339_validator import validate_rfc3339 | ||
64 | + except ImportError: | ||
65 | + validate_rfc3339 = None | ||
66 | + | ||
67 | +if validate_rfc3339: | ||
68 | @_checks_drafts(name="date-time") | ||
69 | def is_datetime(instance): | ||
70 | if not isinstance(instance, str_types): | ||
71 | return True | ||
72 | - return strict_rfc3339.validate_rfc3339(instance) | ||
73 | + return validate_rfc3339(instance) | ||
74 | |||
75 | @_checks_drafts(draft7="time") | ||
76 | def is_time(instance): | ||
77 | diff --git a/setup.cfg b/setup.cfg | ||
78 | index 74bc4a7..878221c 100644 | ||
79 | --- a/setup.cfg | ||
80 | +++ b/setup.cfg | ||
81 | @@ -40,6 +40,12 @@ format = | ||
82 | rfc3987 | ||
83 | strict-rfc3339 | ||
84 | webcolors | ||
85 | +format_nongpl = | ||
86 | + idna | ||
87 | + jsonpointer>1.13 | ||
88 | + webcolors | ||
89 | + rfc3986-validator>0.1.0 | ||
90 | + rfc3339-validator | ||
91 | |||
92 | [options.entry_points] | ||
93 | console_scripts = | ||
94 | -- | ||
95 | 2.20.1 | ||
96 | |||
diff --git a/meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb b/meta-python/recipes-devtools/python/python-jsonschema_3.2.0.bb index b677c646e..b677c646e 100644 --- a/meta-python/recipes-devtools/python/python-jsonschema_3.1.1.bb +++ b/meta-python/recipes-devtools/python/python-jsonschema_3.2.0.bb | |||
diff --git a/meta-python/recipes-devtools/python/python3-jsonschema_3.1.1.bb b/meta-python/recipes-devtools/python/python3-jsonschema_3.2.0.bb index 926990747..926990747 100644 --- a/meta-python/recipes-devtools/python/python3-jsonschema_3.1.1.bb +++ b/meta-python/recipes-devtools/python/python3-jsonschema_3.2.0.bb | |||