From ca1ceb69eb792003ae1143b75a999a15cff5e9bba0d21260460619eebb0ddb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 12 Mar 2020 07:44:31 +0000 Subject: [PATCH] - Add patch to fix build with new webcolors: * webcolors.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonschema?expand=0&rev=45 --- python-jsonschema.changes | 6 ++++++ python-jsonschema.spec | 6 +++--- webcolors.patch | 41 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 webcolors.patch diff --git a/python-jsonschema.changes b/python-jsonschema.changes index 18d0a8f..e5692c0 100644 --- a/python-jsonschema.changes +++ b/python-jsonschema.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 12 07:44:16 UTC 2020 - Tomáš Chvátal + +- Add patch to fix build with new webcolors: + * webcolors.patch + ------------------------------------------------------------------- Fri Nov 22 06:06:52 UTC 2019 - Arun Persaud diff --git a/python-jsonschema.spec b/python-jsonschema.spec index 77ed001..4fe7f10 100644 --- a/python-jsonschema.spec +++ b/python-jsonschema.spec @@ -1,7 +1,7 @@ # # spec file for package python-jsonschema # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-jsonschema -# v3 incompatibility with OpenStack raised upstream at -# https://github.com/Julian/jsonschema/issues/604 Version: 3.2.0 Release: 0 Summary: An implementation of JSON-Schema validation for Python License: MIT URL: https://github.com/Julian/jsonschema Source: https://files.pythonhosted.org/packages/source/j/jsonschema/jsonschema-%{version}.tar.gz +Patch0: webcolors.patch BuildRequires: %{python_module Twisted} BuildRequires: %{python_module attrs >= 17.4.0} BuildRequires: %{python_module idna} @@ -63,6 +62,7 @@ for Python (supporting 2.6+ including Python 3). %prep %setup -q -n jsonschema-%{version} +%patch0 -p1 %build %python_build diff --git a/webcolors.patch b/webcolors.patch new file mode 100644 index 0000000..4289608 --- /dev/null +++ b/webcolors.patch @@ -0,0 +1,41 @@ +From 0d192e192526252c30c16b3651c293bb5f21a99f Mon Sep 17 00:00:00 2001 +From: Julian Berman +Date: Fri, 21 Feb 2020 09:56:13 -0500 +Subject: [PATCH] Sigh... but also drops Py2 compat. + +--- + jsonschema/_format.py | 11 ++++++++--- + setup.cfg | 4 ++-- + 2 files changed, 10 insertions(+), 5 deletions(-) + +Index: jsonschema-3.2.0/jsonschema/_format.py +=================================================================== +--- jsonschema-3.2.0.orig/jsonschema/_format.py ++++ jsonschema-3.2.0/jsonschema/_format.py +@@ -342,10 +342,15 @@ def is_draft3_time(instance): + return datetime.datetime.strptime(instance, "%H:%M:%S") + + +-try: ++try: # webcolors>=1.11 ++ from webcolors import CSS21_NAMES_TO_HEX + import webcolors + except ImportError: +- pass ++ try: # webcolors<1.11 ++ from webcolors import css21_names_to_hex as CSS21_NAMES_TO_HEX ++ import webcolors ++ except ImportError: ++ pass + else: + def is_css_color_code(instance): + return webcolors.normalize_hex(instance) +@@ -354,7 +359,7 @@ else: + def is_css21_color(instance): + if ( + not isinstance(instance, str_types) or +- instance.lower() in webcolors.css21_names_to_hex ++ instance.lower() in CSS21_NAMES_TO_HEX + ): + return True + return is_css_color_code(instance)