[packages/python3-jsonschema] - up to 4.23.0, documentation build is broken

baggins baggins at pld-linux.org
Sat Mar 29 23:47:08 CET 2025


commit 71795fcfe4be9d9410e9f0b30bd3daf319079d2e
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Mar 30 00:47:00 2025 +0100

    - up to 4.23.0, documentation build is broken

 python-jsonschema-nonet.patch                     |  18 ----
 python-jsonschema-webcolors.patch                 | 100 ---------------------
 python-jsonschema.spec => python3-jsonschema.spec | 102 +++-------------------
 3 files changed, 13 insertions(+), 207 deletions(-)
---
diff --git a/python-jsonschema.spec b/python3-jsonschema.spec
similarity index 51%
rename from python-jsonschema.spec
rename to python3-jsonschema.spec
index b088eea..67e455f 100644
--- a/python-jsonschema.spec
+++ b/python3-jsonschema.spec
@@ -1,58 +1,31 @@
 #
 # Conditional build:
-%bcond_without	doc	# Sphinx documentation
+%bcond_with	doc	# Sphinx documentation
 %bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
 
-%define 	module	jsonschema
+%define		module	jsonschema
 Summary:	An implementation of JSON Schema validation for Python 2
 Summary(pl.UTF-8):	Implementacja sprawdzania poprawności schematu JSON dla Pythona 2
-Name:		python-%{module}
+Name:		python3-%{module}
 # keep 3.x here for python2 support
-Version:	3.2.0
-Release:	7
+Version:	4.23.0
+Release:	1
 License:	MIT
 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
+# Source0-md5:	a2cb5fee4da011118708ab275b34f30b
 # https://json-schema.org/draft-07/json-schema-validation.html (differrent email hashes generated on each download)
 Source1:	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
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools
-BuildRequires:	python-setuptools_scm
-BuildRequires:	python-vcversioner >= 2.16.0.0
-%if %{with tests}
-BuildRequires:	python-attrs >= 17.4.0
-BuildRequires:	python-idna
-BuildRequires:	python-importlib_metadata
-BuildRequires:	python-jsonpointer >= 1.14
-BuildRequires:	python-pyrsistent >= 0.14.0
-BuildRequires:	python-rfc3987
-BuildRequires:	python-six >= 1.11.0
-BuildRequires:	python-strict_rfc3339
-BuildRequires:	python-twisted
-BuildRequires:	python-webcolors
-%endif
-%endif
-%if %{with python3}
 BuildRequires:	python3-modules >= 1:3.5
-BuildRequires:	python3-setuptools
-BuildRequires:	python3-setuptools_scm
+BuildRequires:	python3-build
+BuildRequires:	python3-installer
 BuildRequires:	python3-vcversioner >= 2.16.0.0
 %if %{with tests}
 BuildRequires:	python3-attrs >= 17.4.0
 BuildRequires:	python3-idna
-%if "%{py3_ver}" < "3.8"
-BuildRequires:	python-importlib_metadata
-%endif
 BuildRequires:	python3-jsonpointer >= 1.14
 BuildRequires:	python3-pyrsistent >= 0.14.0
 BuildRequires:	python3-rfc3987
@@ -62,7 +35,6 @@ BuildRequires:	python3-strict_rfc3339
 BuildRequires:	python3-twisted
 BuildRequires:	python3-webcolors
 %endif
-%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with doc}
@@ -84,89 +56,41 @@ jsonschema is an implementation of JSON Schema
 jsonschema to implementacja JSON Schema (<https://json-schema.org/>)
 dla Pythona.
 
-%package -n python3-%{module}
-Summary:	An implementation of JSON Schema validation for Python 3
-Summary(pl.UTF-8):	Implementacja sprawdzania poprawności schematu JSON dla Pythona 3
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-%{module}
-jsonschema is an implementation of JSON Schema
-(<https://json-schema.org/>) for Python.
-
-%description -n python3-%{module} -l pl.UTF-8
-jsonschema to implementacja JSON Schema (<https://json-schema.org/>)
-dla Pythona.
-
 %prep
 %setup -q -n %{module}-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
 
 install -d docs/_cache
 cp -p %{SOURCE1} docs/_cache/spec.html
 
 %build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd) \
-trial-2 jsonschema
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
+%py3_build_pyproject
 
 %if %{with tests}
 PYTHONPATH=$(pwd) \
 trial-3 jsonschema
 %endif
-%endif
 
 %if %{with doc}
-PYTHONPATH=$(pwd) \
 %{__make} -C docs html \
-	PYTHON="%{__python3}"
+	SPHINXBUILD=sphinx-build-3
+rm -rf docs/_build/html/_sources
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
-%py_install
-
-%py_postclean
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-2}
-%endif
-
-%if %{with python3}
-%py3_install
+%py3_install_pyproject
 
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jsonschema{,-3}
 ln -sf jsonschema-3 $RPM_BUILD_ROOT%{_bindir}/jsonschema
-%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc CHANGELOG.rst COPYING README.rst
-%attr(755,root,root) %{_bindir}/jsonschema-2
-%{py_sitescriptdir}/jsonschema
-%{py_sitescriptdir}/jsonschema-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc CHANGELOG.rst COPYING README.rst
 %attr(755,root,root) %{_bindir}/jsonschema
 %attr(755,root,root) %{_bindir}/jsonschema-3
 %{py3_sitescriptdir}/jsonschema
-%{py3_sitescriptdir}/jsonschema-%{version}-py*.egg-info
-%endif
+%{py3_sitescriptdir}/jsonschema-%{version}.dist-info
diff --git a/python-jsonschema-nonet.patch b/python-jsonschema-nonet.patch
deleted file mode 100644
index ba65e32..0000000
--- a/python-jsonschema-nonet.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- 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)
- 
diff --git a/python-jsonschema-webcolors.patch b/python-jsonschema-webcolors.patch
deleted file mode 100644
index 944f2f0..0000000
--- a/python-jsonschema-webcolors.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 09595a50f507399bf3fa8c68ed6371c42b9c4874 Mon Sep 17 00:00:00 2001
-From: Julian Berman <Julian at GrayVines.com>
-Date: Fri, 21 Feb 2020 09:30:05 -0500
-Subject: [PATCH] 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 281a7cfc..f3c758c4 100644
---- a/jsonschema/_format.py
-+++ b/jsonschema/_format.py
-@@ -354,7 +354,7 @@ def is_css_color_code(instance):
-     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)
-#diff --git a/setup.cfg b/setup.cfg
-#index 250c15be..a75c1150 100644
-#--- a/setup.cfg
-#+++ b/setup.cfg
-#@@ -40,11 +40,11 @@ format =
-#     jsonpointer>1.13
-#     rfc3987
-#     strict-rfc3339
-#-    webcolors
-#+    webcolors>=1.11.1
-# format_nongpl =
-#     idna
-#     jsonpointer>1.13
-#-    webcolors
-#+    webcolors>=1.11.1
-#     rfc3986-validator>0.1.0
-#     rfc3339-validator
-# 
-From 0d192e192526252c30c16b3651c293bb5f21a99f Mon Sep 17 00:00:00 2001
-From: Julian Berman <Julian at GrayVines.com>
-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(-)
-
-diff --git a/jsonschema/_format.py b/jsonschema/_format.py
-index f3c758c4..b96efb69 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 @@ def is_css_color_code(instance):
-     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)
-#diff --git a/setup.cfg b/setup.cfg
-#index a75c1150..250c15be 100644
-#--- a/setup.cfg
-#+++ b/setup.cfg
-#@@ -40,11 +40,11 @@ format =
-#     jsonpointer>1.13
-#     rfc3987
-#     strict-rfc3339
-#-    webcolors>=1.11.1
-#+    webcolors
-# format_nongpl =
-#     idna
-#     jsonpointer>1.13
-#-    webcolors>=1.11.1
-#+    webcolors
-#     rfc3986-validator>0.1.0
-#     rfc3339-validator
-# 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-jsonschema.git/commitdiff/71795fcfe4be9d9410e9f0b30bd3daf319079d2e



More information about the pld-cvs-commit mailing list