public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pint] rpmlint-etc: Backport a fix for Python 3.13 compatibility (fix RHBZ#2256753)
Date: Sat, 12 Sep 2026 10:21:53 GMT	[thread overview]
Message-ID: <178920851393.1.14265036821388921274.rpms-python-pint-7ff5e9207563@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-pint
Branch : rpmlint-etc
Commit : 7ff5e9207563c7d97056611bc8254ab9bd4653cc
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2024-01-04T08:43:23-05:00
Stats  : +45/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pint/c/7ff5e9207563c7d97056611bc8254ab9bd4653cc?branch=rpmlint-etc

Log:
Backport a fix for Python 3.13 compatibility (fix RHBZ#2256753)

---
diff --git a/0001-Downstream-only-Backport-fix-for-importlib.resources.patch b/0001-Downstream-only-Backport-fix-for-importlib.resources.patch
new file mode 100644
index 0000000..c17d6b0
--- /dev/null
+++ b/0001-Downstream-only-Backport-fix-for-importlib.resources.patch
@@ -0,0 +1,30 @@
+From 3cce96928581d5888f4f0b8a7b4ed07e49bcb2e7 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 4 Jan 2024 08:32:17 -0500
+Subject: [PATCH] Downstream-only: Backport fix for importlib.resources.path
+ removal
+
+Imitate current versions of flexparser, which was split out as a
+separate library in later releases of pint.
+---
+ pint/parser.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/pint/parser.py b/pint/parser.py
+index e73e578..e1127a2 100644
+--- a/pint/parser.py
++++ b/pint/parser.py
+@@ -261,7 +261,9 @@ class Parser:
+         it will use python importlib.resources.read_binary
+         """
+ 
+-        with resources.path(__package__, resource_name) as p:
++        with resources.as_file(
++            resources.files(__package__).joinpath(resource_name)
++        )as p:
+             filepath = p.resolve()
+ 
+         if filepath.exists():
+-- 
+2.43.0
+

diff --git a/python-pint.spec b/python-pint.spec
index a1cc74b..b4c605b 100644
--- a/python-pint.spec
+++ b/python-pint.spec
@@ -28,6 +28,21 @@ Patch:          %{url}/commit/b3b18277ecc682bff7ca1fa9e48992f7ec68e47f.patch
 # Cherry-picked to 0.19.
 Patch:          0001-add-min-and-max-to-the-array-function-overrides.patch
 
+# Downstream-only: Backport fix for importlib.resources.path removal
+#
+# Imitate current versions of flexparser, which was split out as a
+# separate library in later releases of pint.
+#
+# This is resolved in current upstream releases of pint; see
+# https://src.fedoraproject.org/rpms/python-pint/pull-request/10.
+#
+# Fixes:
+#
+# python-pint fails to build with Python 3.13: AttributeError: module
+# 'importlib.resources' has no attribute 'path'
+# https://bugzilla.redhat.com/show_bug.cgi?id=2256746
+Patch:          0001-Downstream-only-Backport-fix-for-importlib.resources.patch
+
 BuildArch:      noarch
 
 %global _description %{expand:

                 reply	other threads:[~2026-09-12 10:21 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=178920851393.1.14265036821388921274.rpms-python-pint-7ff5e9207563@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --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