mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-10-14 18:51:28 -04:00
dev-python/python-fire: support python 3.14
Adds missing python usedeps & patches for python 3.14 support as well as to make all tests pass. The original homepage is from the original author. Since the google fork has more fixes, and is the one used in this package, it's homepage has been added. Signed-off-by: bakedsnake <bakedsnake@vagrantz.xyz>
This commit is contained in:
3 files changed
+66
-11
No files matched your search
@@ -0,0 +1,22 @@
|
||||
From: https://github.com/google/python-fire/commit/716bbc23d7eca949fdb682172283c8d18f742cb6
|
||||
From: David Bieber <david810@gmail.com>
|
||||
Subject: [PATCH] Add Python 3.13 and 3.14 checking in build workflow (#623)
|
||||
* Add Python 3.13 and 3.14 checking in build workflow
|
||||
|
||||
--- a/fire/core.py 2024-09-22 18:14:50.000000000 +0200
|
||||
+++ b/fire/core.py 2026-08-13 23:36:49.448259702 +0200
|
||||
@@ -678,8 +678,12 @@
|
||||
|
||||
# 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:
|
||||
+ component = asyncio.run(fn(*varargs, **kwargs))
|
||||
+ else:
|
||||
+ component = loop.run_until_complete(fn(*varargs, **kwargs))
|
||||
else:
|
||||
component = fn(*varargs, **kwargs)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: https://github.com/google/python-fire/commit/716bbc23d7eca949fdb682172283c8d18f742cb6
|
||||
From: David Bieber <david810@gmail.com>
|
||||
Subject: [PATCH] Add Python 3.13 and 3.14 checking in build workflow (#623)
|
||||
* Add Python 3.13 and 3.14 checking in build workflow
|
||||
|
||||
--- a/fire/inspectutils.py 2026-08-13 22:49:35.213681329 +0200
|
||||
+++ b/fire/inspectutils.py 2026-08-13 22:51:08.232253224 +0200
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
"""Inspection utility functions for Python Fire."""
|
||||
|
||||
-import asyncio
|
||||
import inspect
|
||||
import sys
|
||||
import types
|
||||
@@ -343,6 +342,6 @@
|
||||
|
||||
def IsCoroutineFunction(fn):
|
||||
try:
|
||||
- return asyncio.iscoroutinefunction(fn)
|
||||
+ return inspect.iscoroutinefunction(fn)
|
||||
except: # pylint: disable=bare-except
|
||||
return False
|
||||
+21
-11
@@ -9,29 +9,41 @@ PYPI_PN="fire"
|
||||
inherit distutils-r1 pypi
|
||||
|
||||
DESCRIPTION="Library for automatically generating command line interfaces from Python objects"
|
||||
HOMEPAGE="https://pypi.org/project/python-fire/"
|
||||
HOMEPAGE="https://pypi.org/project/fire"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/six
|
||||
dev-python/termcolor
|
||||
${PYTHON_DEPS}
|
||||
dev-python/six[${PYTHON_USEDEP}]
|
||||
dev-python/termcolor[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
test? (
|
||||
dev-python/hypothesis
|
||||
dev-python/mock
|
||||
dev-python/pytest-asyncio
|
||||
dev-python/termcolor
|
||||
dev-python/hypothesis
|
||||
dev-python/hypothesis[${PYTHON_USEDEP}]
|
||||
dev-python/mock[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
|
||||
dev-python/termcolor[${PYTHON_USEDEP}]
|
||||
dev-python/hypothesis[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/python-fire-asyncio.patch"
|
||||
"${FILESDIR}/python-fire-inspect.patch"
|
||||
)
|
||||
|
||||
EPYTEST_PLUGINS=( )
|
||||
EPYTEST_DESELECT=( "fire/fire_test.py::FireTest::testFireAsyncio" )
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
@@ -45,5 +57,3 @@ src_prepare() {
|
||||
sed -ie "/tests_require/d" setup.py \
|
||||
|| die "Failed to remove deprecated `tests_require`"
|
||||
}
|
||||
|
||||
distutils_enable_tests pytest
|
||||
Reference in new issue
Block a user