public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-PyMuPDF] rawhide: fix FTBFS with python 3.15
@ 2026-06-05 20:53 Michael J Gruber
  0 siblings, 0 replies; only message in thread
From: Michael J Gruber @ 2026-06-05 20:53 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-PyMuPDF
Branch : rawhide
Commit : 0eb037e6b4075db6754bd473eefcba525de4ca9c
Author : Michael J Gruber <mjg@fedoraproject.org>
Date   : 2026-06-05T22:23:24+02:00
Stats  : +97/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-PyMuPDF/c/0eb037e6b4075db6754bd473eefcba525de4ca9c?branch=rawhide

Log:
fix FTBFS with python 3.15

---
diff --git a/0001-remove-usage-of-typing.ByteString.patch b/0001-remove-usage-of-typing.ByteString.patch
new file mode 100644
index 0000000..6fd14c8
--- /dev/null
+++ b/0001-remove-usage-of-typing.ByteString.patch
@@ -0,0 +1,95 @@
+From f5bfa9dc0c80b3715fa8526d81694aa5c54a1fa5 Mon Sep 17 00:00:00 2001
+Message-ID: <f5bfa9dc0c80b3715fa8526d81694aa5c54a1fa5.1780689448.git.mjg@fedoraproject.org>
+From: Michael J Gruber <mjg@fedoraproject.org>
+Date: Fri, 5 Jun 2026 21:55:08 +0200
+Subject: [PATCH] remove usage of typing.ByteString
+
+typing.ByteString is deprecated in python 3.15 and slated for removal in
+python 3.17. This creates deprecation warnings which trip up our tests.
+
+Since we are requiring python >= 3.10 already, we can switch to the
+proper alterantive unconditionally now.
+---
+ src/__init__.py        | 7 +------
+ src/utils.py           | 9 ++-------
+ src_classic/fitz_old.i | 7 +------
+ src_classic/utils.py   | 7 +------
+ 4 files changed, 5 insertions(+), 25 deletions(-)
+
+diff --git a/src/__init__.py b/src/__init__.py
+index 8b756ccf..2bff8ec0 100644
+--- a/src/__init__.py
++++ b/src/__init__.py
+@@ -462,12 +462,7 @@ def _format_g(value, *, fmt='%g'):
+         
+ format_g = _format_g
+ 
+-# ByteString is gone from typing in 3.14.
+-# collections.abc.Buffer available from 3.12 only
+-try:
+-    ByteString = typing.ByteString
+-except AttributeError:
+-    ByteString = bytes | bytearray | memoryview
++ByteString = bytes | bytearray | memoryview
+ 
+ # Names required by class method typing annotations.
+ OptBytes = typing.Optional[ByteString]
+diff --git a/src/utils.py b/src/utils.py
+index 7d3271ea..e42a1c0b 100644
+--- a/src/utils.py
++++ b/src/utils.py
+@@ -24,13 +24,8 @@ rect_like = "rect_like"
+ matrix_like = "matrix_like"
+ quad_like = "quad_like"
+ 
+-# ByteString is gone from typing in 3.14.
+-# collections.abc.Buffer available from 3.12 only
+-try:
+-    ByteString = typing.ByteString
+-except AttributeError:
+-    # pylint: disable=unsupported-binary-operation
+-    ByteString = bytes | bytearray | memoryview
++# pylint: disable=unsupported-binary-operation
++ByteString = bytes | bytearray | memoryview
+ 
+ AnyType = typing.Any
+ OptInt = typing.Union[int, None]
+diff --git a/src_classic/fitz_old.i b/src_classic/fitz_old.i
+index 8abc8955..3e94b3bc 100644
+--- a/src_classic/fitz_old.i
++++ b/src_classic/fitz_old.i
+@@ -322,12 +322,7 @@ rect_like = "rect_like"
+ matrix_like = "matrix_like"
+ quad_like = "quad_like"
+ 
+-# ByteString is gone from typing in 3.14.
+-# collections.abc.Buffer available from 3.12 only
+-try:
+-    ByteString = typing.ByteString
+-except AttributeError:
+-    ByteString = bytes | bytearray | memoryview
++ByteString = bytes | bytearray | memoryview
+ 
+ AnyType = typing.Any
+ OptInt = typing.Union[int, None]
+diff --git a/src_classic/utils.py b/src_classic/utils.py
+index c1369afb..3639834c 100644
+--- a/src_classic/utils.py
++++ b/src_classic/utils.py
+@@ -24,12 +24,7 @@ rect_like = "rect_like"
+ matrix_like = "matrix_like"
+ quad_like = "quad_like"
+ 
+-# ByteString is gone from typing in 3.14.
+-# collections.abc.Buffer available from 3.12 only
+-try:
+-    ByteString = typing.ByteString
+-except AttributeError:
+-    ByteString = bytes | bytearray | memoryview
++ByteString = bytes | bytearray | memoryview
+ 
+ AnyType = typing.Any
+ OptInt = typing.Union[int, None]
+-- 
+2.54.0.1146.g083d50a523
+

diff --git a/python-PyMuPDF.spec b/python-PyMuPDF.spec
index d3ebfe6..a43d0f2 100644
--- a/python-PyMuPDF.spec
+++ b/python-PyMuPDF.spec
@@ -24,6 +24,8 @@ Patch:		0001-adjust-tests-to-tesseract-5.5.1.patch
 Patch:		0001-tests-conftest-do-not-call-pip.patch
 # Upstream patches from main branch:
 Patch:		0001-src-__init__.py-fix-incorrect-generation-of-PDF-cont.patch
+# Upstreamable:
+Patch:		0001-remove-usage-of-typing.ByteString.patch
 
 # test dependencies not picked up by generator
 BuildRequires:	python3dist(pillow)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-05 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-05 20:53 [rpms/python-PyMuPDF] rawhide: fix FTBFS with python 3.15 Michael J Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox