public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michael J Gruber <mjg@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/python-PyMuPDF] rawhide: fix FTBFS with python 3.15
Date: Fri, 05 Jun 2026 20:53:23 GMT	[thread overview]
Message-ID: <178069280371.1.7245670655782970633.rpms-python-PyMuPDF-0eb037e6b407@fedoraproject.org> (raw)

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)

                 reply	other threads:[~2026-06-05 20:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178069280371.1.7245670655782970633.rpms-python-PyMuPDF-0eb037e6b407@fedoraproject.org \
    --to=mjg@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox