* [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonschema/files/, dev-python/jsonschema/
@ 2020-03-17 1:49 Matt Turner
0 siblings, 0 replies; only message in thread
From: Matt Turner @ 2020-03-17 1:49 UTC (permalink / raw
To: gentoo-commits
commit: b649f7ce7976cdedf52da4aab3f6ad57fc33267b
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 17 01:47:55 2020 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Tue Mar 17 01:48:28 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b649f7ce
dev-python/jsonschema: Add webcolors-1.11 compatibility
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
...sonschema-3.2.0-add-webcolors-1.11-compat.patch | 70 ++++++++++++++++++++++
dev-python/jsonschema/jsonschema-3.2.0.ebuild | 4 ++
2 files changed, 74 insertions(+)
diff --git a/dev-python/jsonschema/files/jsonschema-3.2.0-add-webcolors-1.11-compat.patch b/dev-python/jsonschema/files/jsonschema-3.2.0-add-webcolors-1.11-compat.patch
new file mode 100644
index 00000000000..bfb4fa8d139
--- /dev/null
+++ b/dev-python/jsonschema/files/jsonschema-3.2.0-add-webcolors-1.11-compat.patch
@@ -0,0 +1,70 @@
+From 09595a50f507399bf3fa8c68ed6371c42b9c4874 Mon Sep 17 00:00:00 2001
+From: Julian Berman <Julian@GrayVines.com>
+Date: Fri, 21 Feb 2020 09:30:05 -0500
+Subject: [PATCH 1/2] Newer webcolors has a new API apparently.
+
+---
+ jsonschema/_format.py | 2 +-
+ setup.cfg | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/jsonschema/_format.py b/jsonschema/_format.py
+index 281a7cf..f3c758c 100644
+--- a/jsonschema/_format.py
++++ b/jsonschema/_format.py
+@@ -354,7 +354,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 webcolors.CSS21_NAMES_TO_HEX
+ ):
+ return True
+ return is_css_color_code(instance)
+--
+2.24.1
+
+From 0d192e192526252c30c16b3651c293bb5f21a99f Mon Sep 17 00:00:00 2001
+From: Julian Berman <Julian@GrayVines.com>
+Date: Fri, 21 Feb 2020 09:56:13 -0500
+Subject: [PATCH 2/2] Sigh... but also drops Py2 compat.
+
+---
+ jsonschema/_format.py | 11 ++++++++---
+ setup.cfg | 4 ++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/jsonschema/_format.py b/jsonschema/_format.py
+index f3c758c..b96efb6 100644
+--- a/jsonschema/_format.py
++++ b/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)
+--
+2.24.1
+
diff --git a/dev-python/jsonschema/jsonschema-3.2.0.ebuild b/dev-python/jsonschema/jsonschema-3.2.0.ebuild
index 9163778afc7..868c8ece6a7 100644
--- a/dev-python/jsonschema/jsonschema-3.2.0.ebuild
+++ b/dev-python/jsonschema/jsonschema-3.2.0.ebuild
@@ -41,6 +41,10 @@ RDEPEND="${BDEPEND}
RESTRICT="!test? ( test )"
+PATCHES=(
+ "${FILESDIR}"/${P}-add-webcolors-1.11-compat.patch
+)
+
distutils_enable_tests unittest
python_prepare_all() {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-17 1:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-17 1:49 [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonschema/files/, dev-python/jsonschema/ Matt Turner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox