python-hiredis: FTBFS against python 3.15rc1
Maximiliano Curia <[email protected]>
| Newsgroups | gmane.linux.debian.devel.python |
|---|---|
| Message-ID | <[email protected]> |
Package: src:python-hiredis Version: 2.3.2-2 User: [email protected] Usertags: python3.15 Tags: patch, ftbfs, forky, sid Hi! While rebuilding the python related packages against the Python 3.15rc1 version we found that TODO fails to build from source [1]. The issue is hiredis uses load_module in its setup.py, which is deprecated since python 3.4, and removed in 3.15. Upstream already tackled this problem and fixed the issue with the commit "MNT: do not use deprecated load_module method"[2], which is included in the upstream release 3.4.0. I applied the upstream fix in the sandbox [3] to be able to build the packages that depend on python-hiredis, please consider applying the patch or updating the package to a newer upstream release to support the upcoming 3.15 version. Happy hacking, [1]: https://debusine.debian.net/debian/r-python-python3.15/work-request/999452/ [2]: https://github.com/redis/hiredis-py/commit/475d682cbf7f601785dfda68c79df313aca6bc06 [3]: https://debusine.debian.net/debian/r-python-python3.15/ -- "Can you imagine what I would do if I could do all I can?" -- Sun Tzu Saludos /\/\ /\ >< `/
0002-MNT-do-not-use-deprecated-load_module-method.patch
(text/x-diff, 1.5 KB)
From: Thomas A Caswell <[email protected]> Date: Fri, 30 Jan 2026 10:52:32 -0500 Subject: MNT: do not use deprecated load_module method (#218) The load_module method has been deprecated from py34 and will be removed in py315 [1] (it is already gone on CPython main). The recommended replacement is exec_module, however the documentation [2] suggests to use a simpler approach than using the loaders directly and runpy [3] seemed better than sys.path hacking. Given that this is a one-line file simply reading the file and parsing it 'by hand' is an option. [1] https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module [2] https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly [3] https://docs.python.org/3/library/runpy.html#runpy.run_path Co-authored-by: Igor Malinovskiy <[email protected]> --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 93e5a37..77e84ce 100644 --- a/setup.py +++ b/setup.py @@ -4,17 +4,14 @@ try: from setuptools import setup, Extension except ImportError: from distutils.core import setup, Extension -import importlib +import runpy import glob import io import sys def version(): - loader = importlib.machinery.SourceFileLoader( - "hiredis.version", "hiredis/version.py") - module = loader.load_module() - return module.__version__ + return runpy.run_path("hiredis/version.py")["__version__"] def get_sources():