[packages/python-jsonschema] - added nonet patch, add json-schema-validation.html as source instead of downloading
qboosh
qboosh at pld-linux.org
Tue Apr 14 18:49:14 CEST 2020
commit fd27cec932b77355d0f56b14b485fb31209e4469
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Apr 14 18:49:19 2020 +0200
- added nonet patch, add json-schema-validation.html as source instead of downloading
python-jsonschema-nonet.patch | 18 ++++++++++++++++++
python-jsonschema.spec | 7 +++++++
2 files changed, 25 insertions(+)
---
diff --git a/python-jsonschema.spec b/python-jsonschema.spec
index 3a176a3..0457f68 100644
--- a/python-jsonschema.spec
+++ b/python-jsonschema.spec
@@ -16,7 +16,10 @@ Group: Libraries/Python
#Source0Download: https://pypi.python.org/simple/jsonschema/
Source0: https://files.pythonhosted.org/packages/source/j/jsonschema/%{module}-%{version}.tar.gz
# Source0-md5: f1a0b5011f05a02a8dee1070cd10a26d
+Source1: https://json-schema.org/draft-07/json-schema-validation.html
+# Source1-md5: e920693b4c00338d439f0a2240218bcf
Patch0: %{name}-webcolors.patch
+Patch1: %{name}-nonet.patch
URL: https://pypi.python.org/pypi/jsonschema
%if %{with python2}
BuildRequires: python-functools32
@@ -95,6 +98,10 @@ dla Pythona.
%prep
%setup -q -n %{module}-%{version}
%patch0 -p1
+%patch1 -p1
+
+install -d docs/_cache
+cp -p %{SOURCE1} docs/_cache/spec.html
%build
%if %{with python2}
diff --git a/python-jsonschema-nonet.patch b/python-jsonschema-nonet.patch
new file mode 100644
index 0000000..ba65e32
--- /dev/null
+++ b/python-jsonschema-nonet.patch
@@ -0,0 +1,18 @@
+--- jsonschema-3.2.0/docs/jsonschema_role.py.orig 2019-10-08 03:37:30.000000000 +0200
++++ jsonschema-3.2.0/docs/jsonschema_role.py 2020-04-14 18:33:13.541326079 +0200
+@@ -63,15 +63,6 @@
+ if error.errno != errno.ENOENT:
+ raise
+
+- request = urllib.Request(VALIDATION_SPEC, headers=headers)
+- response = urllib.urlopen(request, cafile=certifi.where())
+-
+- if response.code == 200:
+- with open(spec_path, "w+b") as spec:
+- spec.writelines(response)
+- spec.seek(0)
+- return html.parse(spec)
+-
+ with open(spec_path) as spec:
+ return html.parse(spec)
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-jsonschema.git/commitdiff/fd27cec932b77355d0f56b14b485fb31209e4469
More information about the pld-cvs-commit
mailing list