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-loguru] epel10.3: Backport several Python 3.14 patches etc. for parity with Rawhide
Date: Wed, 04 Nov 2026 10:14:50 GMT	[thread overview]
Message-ID: <179378729026.1.9899581196781155285.rpms-python-loguru-6bd274a2e4f7@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/python-loguru
            Branch : epel10.3
            Commit : 6bd274a2e4f7f69dcd39a7e66574a766d36b45ba
            Author : Benjamin A. Beasley <code@musicinmybrain.net>
            Date   : 2026-11-04T09:57:52+00:00
            Stats  : +135/-34 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-loguru/c/6bd274a2e4f7f69dcd39a7e66574a766d36b45ba?branch=epel10.3

            Log:
            Backport several Python 3.14 patches etc. for parity with Rawhide

~~~~

Report and ignore a DeprecationWarning in Python 3.14

- Fixes RHBZ#2345523; see https://github.com/Delgan/loguru/issues/1296

~~~~

Backport a patch for a DeprecationWarning in Python 3.14

- As a side effect, we no longer need to patch the tests to work without
  pytest-mypy-plugins.

~~~~

Skip two tests that still fail on Python 3.14

- Close RHBZ#2356181

~~~~

Backport another Python 3.14 fix; all tests now pass

---
diff --git a/0001-Downstream-patch-do-not-depend-on-pytest-mypy-plugin.patch b/0001-Downstream-patch-do-not-depend-on-pytest-mypy-plugin.patch
deleted file mode 100644
index 54e1797..0000000
--- a/0001-Downstream-patch-do-not-depend-on-pytest-mypy-plugin.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From d9ef0ebe4f0d02faa2df77c6a785fd9c28773505 Mon Sep 17 00:00:00 2001
-From: "Benjamin A. Beasley" <code@musicinmybrain.net>
-Date: Fri, 6 Dec 2024 07:27:08 -0500
-Subject: [PATCH] Downstream patch: do not depend on pytest-mypy-plugins
-
-https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
----
- tests/conftest.py | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/tests/conftest.py b/tests/conftest.py
-index a2db04f..c374c87 100644
---- a/tests/conftest.py
-+++ b/tests/conftest.py
-@@ -47,7 +47,11 @@ if sys.version_info < (3, 6):
-         return pathlib.Path(str(tmp_path))
- 
- 
--if sys.version_info >= (3, 6):
-+# Downstream patch: do not depend on pytest-mypy-plugins
-+# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
-+NO_MYPY_PLUGINS = True
-+
-+if sys.version_info >= (3, 6) and not NO_MYPY_PLUGINS:
-     from pytest_mypy_plugins.item import YamlTestItem
- 
-     def _fix_positional_only_args(item: YamlTestItem):
--- 
-2.47.1
-

diff --git a/0001-Fix-deprecation-warning-raised-by-tests-with-Python-.patch b/0001-Fix-deprecation-warning-raised-by-tests-with-Python-.patch
new file mode 100644
index 0000000..1612322
--- /dev/null
+++ b/0001-Fix-deprecation-warning-raised-by-tests-with-Python-.patch
@@ -0,0 +1,69 @@
+From 58bd3fd8e5445c40c2c8d8714a4cc7561c43168d Mon Sep 17 00:00:00 2001
+From: Delgan <4193924+Delgan@users.noreply.github.com>
+Date: Thu, 13 Feb 2025 19:10:32 +0100
+Subject: [PATCH] Fix deprecation warning raised by tests with Python 3.14
+ (#1298)
+
+---
+ pyproject.toml               | 4 +++-
+ tests/conftest.py            | 8 +++++++-
+ tests/test_coroutine_sink.py | 1 +
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index 4ea6eb8..0c17351 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -52,7 +52,7 @@ dev = [
+   "pytest-cov==5.0.0 ; python_version>='3.8' and python_version<'3.9'",
+   "pytest-cov==6.0.0 ; python_version>='3.9'",
+   "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'",
+-  "pytest-mypy-plugins==3.1.0 ; python_version>='3.8'",
++  "pytest-mypy-plugins==3.1.0 ; python_version>='3.8' and python_version<'3.14'",
+   # Testing utils.
+   "colorama==0.4.5 ; python_version<'3.8'",
+   "colorama==0.4.6 ; python_version>='3.8'",
+@@ -99,6 +99,8 @@ filterwarnings = [
+   'error',
+   # Mixing threads and "fork()" is deprecated, but we need to test it anyway.
+   'ignore:.*use of fork\(\) may lead to deadlocks in the child.*:DeprecationWarning',
++  # Using "set_event_loop()" is deprecated, but no alternative is provided.
++  "ignore:.*'asyncio.set_event_loop' is deprecated.*:DeprecationWarning",
+ ]
+ testpaths = ["tests"]
+ 
+diff --git a/tests/conftest.py b/tests/conftest.py
+index a2db04f..7d1c5ca 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -47,8 +47,14 @@ if sys.version_info < (3, 6):
+         return pathlib.Path(str(tmp_path))
+ 
+ 
+-if sys.version_info >= (3, 6):
++try:
+     from pytest_mypy_plugins.item import YamlTestItem
++except ImportError:
++    # The plugin is only available starting with Python 3.6.
++    # Additionally, it has dependencies that are not compatible with Python versions in development.
++    # In both cases, the Mypy tests will be skipped.
++    pass
++else:
+ 
+     def _fix_positional_only_args(item: YamlTestItem):
+         """Remove forward-slash marker from the expected output for Python 3.6."""
+diff --git a/tests/test_coroutine_sink.py b/tests/test_coroutine_sink.py
+index 177fe88..214280a 100644
+--- a/tests/test_coroutine_sink.py
++++ b/tests/test_coroutine_sink.py
+@@ -162,6 +162,7 @@ def test_using_sink_without_running_loop_none(capsys):
+     assert out == ""
+ 
+ 
++@pytest.mark.skipif(sys.version_info >= (3, 16), reason="The 'set_event_loop' function is removed")
+ def test_global_loop_not_used(capsys):
+     with new_event_loop_context() as loop:
+         with set_event_loop_context(loop):
+-- 
+2.48.1
+

diff --git a/84023e2bd8339de95250470f422f096edcb8f7b7.patch b/84023e2bd8339de95250470f422f096edcb8f7b7.patch
new file mode 100644
index 0000000..ed54f04
--- /dev/null
+++ b/84023e2bd8339de95250470f422f096edcb8f7b7.patch
@@ -0,0 +1,58 @@
+From 84023e2bd8339de95250470f422f096edcb8f7b7 Mon Sep 17 00:00:00 2001
+From: Delgan <delgan.py@gmail.com>
+Date: Sat, 5 Jul 2025 22:43:12 +0200
+Subject: [PATCH] Fix failing "exception_modern" unit test with Python 3.14
+ (#1331)
+
+The test relies on the "repr()" output of a few classes which are
+not meant to be considered as a stabilized API. In this
+specific case, "Union" representation was changed upstream from
+"typing.Union" to "<class 'typing.Union'>" (kind of leak
+implementation details).
+
+I simply  replaced the dummy "Union" with "Tuple" in the unit test,
+since its representation appears stable acrcoss versions.
+---
+ tests/exceptions/output/modern/type_hints.txt | 4 ++--
+ tests/exceptions/source/modern/type_hints.py  | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tests/exceptions/output/modern/type_hints.txt b/tests/exceptions/output/modern/type_hints.txt
+index 64484d3f9..917180a32 100644
+--- a/tests/exceptions/output/modern/type_hints.txt
++++ b/tests/exceptions/output/modern/type_hints.txt
+@@ -10,11 +10,11 @@
+     ^[[36m            └ ^[[0m^[[36m^[[1m<function foo at 0xDEADBEEF>^[[0m
+ 
+   File "^[[32mtests/exceptions/source/modern/^[[0m^[[32m^[[1mtype_hints.py^[[0m", line ^[[33m15^[[0m, in ^[[35mfoo^[[0m
+-    ^[[35m^[[1mdef^[[0m ^[[1mfoo^[[0m^[[1m(^[[0m^[[1ma^[[0m^[[1m:^[[0m ^[[1mint^[[0m^[[1m,^[[0m ^[[1mb^[[0m^[[1m:^[[0m ^[[1mUnion^[[0m^[[1m[^[[0m^[[1mName^[[0m^[[1m,^[[0m ^[[1mfloat^[[0m^[[1m]^[[0m^[[1m,^[[0m ^[[1mc^[[0m^[[1m:^[[0m ^[[36m"Name"^[[0m^[[1m)^[[0m ^[[35m^[[1m->^[[0m ^[[1mT^[[0m^[[1m:^[[0m ^[[34m^[[1m1^[[0m ^[[35m^[[1m/^[[0m ^[[34m^[[1m0^[[0m
++    ^[[35m^[[1mdef^[[0m ^[[1mfoo^[[0m^[[1m(^[[0m^[[1ma^[[0m^[[1m:^[[0m ^[[1mint^[[0m^[[1m,^[[0m ^[[1mb^[[0m^[[1m:^[[0m ^[[1mTuple^[[0m^[[1m[^[[0m^[[1mName^[[0m^[[1m,^[[0m ^[[1mfloat^[[0m^[[1m]^[[0m^[[1m,^[[0m ^[[1mc^[[0m^[[1m:^[[0m ^[[36m"Name"^[[0m^[[1m)^[[0m ^[[35m^[[1m->^[[0m ^[[1mT^[[0m^[[1m:^[[0m ^[[34m^[[1m1^[[0m ^[[35m^[[1m/^[[0m ^[[34m^[[1m0^[[0m
+     ^[[36m    │   │       │  │     │             │             └ ^[[0m^[[36m^[[1m~T^[[0m
+     ^[[36m    │   │       │  │     │             └ ^[[0m^[[36m^[[1m3^[[0m
+     ^[[36m    │   │       │  │     └ ^[[0m^[[36m^[[1m<class 'str'>^[[0m
+-    ^[[36m    │   │       │  └ ^[[0m^[[36m^[[1mtyping.Union^[[0m
++    ^[[36m    │   │       │  └ ^[[0m^[[36m^[[1mtyping.Tuple^[[0m
+     ^[[36m    │   │       └ ^[[0m^[[36m^[[1m2^[[0m
+     ^[[36m    │   └ ^[[0m^[[36m^[[1m1^[[0m
+     ^[[36m    └ ^[[0m^[[36m^[[1m<function foo at 0xDEADBEEF>^[[0m
+diff --git a/tests/exceptions/source/modern/type_hints.py b/tests/exceptions/source/modern/type_hints.py
+index 84b36e511..cda95a681 100644
+--- a/tests/exceptions/source/modern/type_hints.py
++++ b/tests/exceptions/source/modern/type_hints.py
+@@ -1,6 +1,6 @@
+ # fmt: off
+ import sys
+-from typing import TypeVar, Union
++from typing import TypeVar, Tuple
+ 
+ from loguru import logger
+ 
+@@ -12,7 +12,7 @@
+ Name = str
+ 
+ 
+-def foo(a: int, b: Union[Name, float], c: "Name") -> T: 1 / 0
++def foo(a: int, b: Tuple[Name, float], c: "Name") -> T: 1 / 0
+ 
+ 
+ def main():

diff --git a/python-loguru.spec b/python-loguru.spec
index 3113886..b8c47bb 100644
--- a/python-loguru.spec
+++ b/python-loguru.spec
@@ -10,9 +10,13 @@ URL:            https://github.com/Delgan/loguru
 # The GitHub archive contains CHANGELOG.rst, which the PyPI sdist lacks.
 Source:         %{url}/archive/%{version}/loguru-%{version}.tar.gz
 
-# Downstream patch: do not depend on pytest-mypy-plugins
-# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
-Patch:          0001-Downstream-patch-do-not-depend-on-pytest-mypy-plugin.patch
+# Fix deprecation warning raised by tests with Python 3.14
+# https://github.com/Delgan/loguru/pull/1298
+# Cherry-picked to 0.7.3
+Patch:          0001-Fix-deprecation-warning-raised-by-tests-with-Python-.patch
+# Fix failing "exception_modern" unit test with Python 3.14 (#1331)
+# https://github.com/Delgan/loguru/commit/84023e2bd8339de95250470f422f096edcb8f7b7
+Patch:          %{url}/commit/84023e2bd8339de95250470f422f096edcb8f7b7.patch
 
 BuildArch:      noarch
 
@@ -67,7 +71,7 @@ Summary:        %{summary}
 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
 ignore="${ignore-} --ignore=tests/typesafety/test_logger.yml"
 
-%pytest ${ignore-} -rs
+%pytest ${ignore-} -k "${k-}" -rs
 %endif
 
 

                 reply	other threads:[~2026-11-04 10:14 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=179378729026.1.9899581196781155285.rpms-python-loguru-6bd274a2e4f7@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