From d5caee59df65b3783d891b4a96ded2720e9324563e2f6cd865ef5ec7a6726752 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 29 Oct 2025 01:10:03 +0000 Subject: [PATCH] - Add patch support-python-314.patch: * Support Python 3.14 asyncio changes. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fire?expand=0&rev=33 --- python-fire.changes | 6 ++++ python-fire.spec | 5 +++- support-python-314.patch | 63 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 support-python-314.patch diff --git a/python-fire.changes b/python-fire.changes index 18888b4..77f73dd 100644 --- a/python-fire.changes +++ b/python-fire.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 29 01:09:09 UTC 2025 - Steve Kowalik + +- Add patch support-python-314.patch: + * Support Python 3.14 asyncio changes. + ------------------------------------------------------------------- Wed Sep 17 12:04:56 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-fire.spec b/python-fire.spec index 636a052..f5d6b98 100644 --- a/python-fire.spec +++ b/python-fire.spec @@ -1,7 +1,7 @@ # # spec file for package python-fire # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %{?sle15_python_module_pythons} Name: python-fire Version: 0.7.1 @@ -23,6 +24,8 @@ Summary: A library for automatically generating command line interfaces License: Apache-2.0 URL: https://github.com/google/python-fire Source: https://files.pythonhosted.org/packages/source/f/fire/fire-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#google/python-fire#623 +Patch0: support-python-314.patch # Based on https://github.com/google/python-fire/pull/265/files BuildRequires: %{python_module setuptools} BuildRequires: %{python_module pip} diff --git a/support-python-314.patch b/support-python-314.patch new file mode 100644 index 0000000..9b21d3c --- /dev/null +++ b/support-python-314.patch @@ -0,0 +1,63 @@ +From 1aa72a66acd4e9dc421deb5523a429f9f4519421 Mon Sep 17 00:00:00 2001 +From: David Bieber +Date: Sat, 16 Aug 2025 16:42:23 -0400 +Subject: [PATCH 1/4] Add Python 3.13 and 3.14 checking in build workflow + +--- + .github/workflows/build.yml | 2 +- + pyproject.toml | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +Index: fire-0.7.1/pyproject.toml +=================================================================== +--- fire-0.7.1.orig/pyproject.toml ++++ fire-0.7.1/pyproject.toml +@@ -24,6 +24,7 @@ classifiers = [ + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ++ "Programming Language :: Python :: 3.14", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", +Index: fire-0.7.1/fire/core.py +=================================================================== +--- fire-0.7.1.orig/fire/core.py ++++ fire-0.7.1/fire/core.py +@@ -678,8 +678,14 @@ def _CallAndUpdateTrace(component, args, + + # Call the function. + if inspectutils.IsCoroutineFunction(fn): +- loop = asyncio.get_event_loop() +- component = loop.run_until_complete(fn(*varargs, **kwargs)) ++ try: ++ loop = asyncio.get_running_loop() ++ except RuntimeError: ++ # No event loop running, create a new one ++ component = asyncio.run(fn(*varargs, **kwargs)) ++ else: ++ # Event loop is already running ++ component = loop.run_until_complete(fn(*varargs, **kwargs)) + else: + component = fn(*varargs, **kwargs) + +Index: fire-0.7.1/fire/inspectutils.py +=================================================================== +--- fire-0.7.1.orig/fire/inspectutils.py ++++ fire-0.7.1/fire/inspectutils.py +@@ -14,7 +14,6 @@ + + """Inspection utility functions for Python Fire.""" + +-import asyncio + import inspect + import sys + import types +@@ -345,6 +344,6 @@ def GetClassAttrsDict(component): + + def IsCoroutineFunction(fn): + try: +- return asyncio.iscoroutinefunction(fn) ++ return inspect.iscoroutinefunction(fn) + except: # pylint: disable=bare-except + return False