public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pint] rpmlint-etc: Minimal patch for compatibility with pytest 8
@ 2026-09-12 10:21 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-09-12 10:21 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-pint
Branch : rpmlint-etc
Commit : 0835a123740f19b405d8d7c015b1689ae89f8a01
Author : Tomáš Hrnčiar <thrnciar@redhat.com>
Date   : 2024-04-18T12:01:23+02:00
Stats  : +71/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pint/c/0835a123740f19b405d8d7c015b1689ae89f8a01?branch=rpmlint-etc

Log:
Minimal patch for compatibility with pytest 8

---
diff --git a/0001-Minimal-patch-for-compatibility-with-pytest-8.patch b/0001-Minimal-patch-for-compatibility-with-pytest-8.patch
new file mode 100644
index 0000000..71cac90
--- /dev/null
+++ b/0001-Minimal-patch-for-compatibility-with-pytest-8.patch
@@ -0,0 +1,67 @@
+From 855ccd6448d06977f2911d9182d946e8206bae6c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
+Date: Thu, 18 Apr 2024 11:47:23 +0200
+Subject: [PATCH] Minimal patch for compatibility with pytest 8
+
+Inspired from upstream commit which does not apply to pint version we
+have in Fedora
+https://github.com/hgrecco/pint/commit/ba5fb6566dcefc1d7d34dfde48e498d69da05347
+---
+ pint/quantity.py | 9 ++++-----
+ pint/testing.py  | 8 ++++----
+ 2 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/pint/quantity.py b/pint/quantity.py
+index 1207b94..2cdb699 100644
+--- a/pint/quantity.py
++++ b/pint/quantity.py
+@@ -824,12 +824,11 @@ class Quantity(PrettyIPython, SharedRegistryObject, Generic[_MagnitudeType]):
+         """
+ 
+         if not isinstance(self.magnitude, numbers.Number):
+-            msg = (
+-                "to_compact applied to non numerical types "
+-                "has an undefined behavior."
++            warnings.warn(
++                "to_compact applied to non numerical types has an undefined behavior.",
++                RuntimeWarning,
++                stacklevel=2,
+             )
+-            w = RuntimeWarning(msg)
+-            warnings.warn(w, stacklevel=2)
+             return self
+ 
+         if (
+diff --git a/pint/testing.py b/pint/testing.py
+index 3334675..485a29d 100644
+--- a/pint/testing.py
++++ b/pint/testing.py
+@@ -42,10 +42,10 @@ def assert_equal(first, second, msg=None):
+     if isinstance(m1, ndarray) or isinstance(m2, ndarray):
+         np.testing.assert_array_equal(m1, m2, err_msg=msg)
+     elif not isinstance(m1, Number):
+-        warnings.warn(RuntimeWarning)
++        warnings.warn("In assert_equal, m1 is not a number ", RuntimeWarning)
+         return
+     elif not isinstance(m2, Number):
+-        warnings.warn(RuntimeWarning)
++        warnings.warn("In assert_equal, m2 is not a number ", RuntimeWarning)
+         return
+     elif math.isnan(m1):
+         assert math.isnan(m2), msg
+@@ -71,10 +71,10 @@ def assert_allclose(first, second, rtol=1e-07, atol=0, msg=None):
+     if isinstance(m1, ndarray) or isinstance(m2, ndarray):
+         np.testing.assert_allclose(m1, m2, rtol=rtol, atol=atol, err_msg=msg)
+     elif not isinstance(m1, Number):
+-        warnings.warn(RuntimeWarning)
++        warnings.warn("In assert_equal, m1 is not a number ", RuntimeWarning)
+         return
+     elif not isinstance(m2, Number):
+-        warnings.warn(RuntimeWarning)
++        warnings.warn("In assert_equal, m2 is not a number ", RuntimeWarning)
+         return
+     elif math.isnan(m1):
+         assert math.isnan(m2), msg
+-- 
+2.44.0
+

diff --git a/python-pint.spec b/python-pint.spec
index b4c605b..3307f42 100644
--- a/python-pint.spec
+++ b/python-pint.spec
@@ -43,6 +43,10 @@ Patch:          0001-add-min-and-max-to-the-array-function-overrides.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=2256746
 Patch:          0001-Downstream-only-Backport-fix-for-importlib.resources.patch
 
+# Compatibility with pytest 8
+# https://github.com/hgrecco/pint/commit/ba5fb6566d.patch
+Patch:          0001-Minimal-patch-for-compatibility-with-pytest-8.patch
+
 BuildArch:      noarch
 
 %global _description %{expand:

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

only message in thread, other threads:[~2026-09-12 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-12 10:21 [rpms/python-pint] rpmlint-etc: Minimal patch for compatibility with pytest 8 

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