Package: src:python-aodhclient
Version: 3.10.1-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 python-aodhclient fails to build from source [1]. I found that the upstream Commit 823d5e3 [2] fixes the issue.
I applied the upstream fix in the sandbox [3] to be able to build the
packages that depend on python-aodhclient, please consider applying the
patch to support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4583572/
[2]: 
https://github.com/openstack/python-aodhclient/commit/823d5e3c223324eb65bf909bed15f6932847cd5d
[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 /\/\ /\ >< `/
From 823d5e3c223324eb65bf909bed15f6932847cd5d Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <[email protected]>
Date: Sun, 12 Jul 2026 02:34:41 +0900
Subject: [PATCH] Replace deprecated pyparsing interfaces

These interfaces were deprecated in pyparsing 3.0.0[1].

[1] https://pyparsing-docs.readthedocs.io/en/latest/whats_new_in_3_0_0.html#api-changes
* camelCase names have been converted to PEP-8 snake_case names.

Change-Id: I241f33c51f9a463fc8d229e04eac65297f23f5d7
Signed-off-by: Takashi Kajinami <[email protected]>
---
 aodhclient/utils.py | 16 ++++++++--------
 requirements.txt    |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/aodhclient/utils.py b/aodhclient/utils.py
index 42580a4..c54d459 100644
--- a/aodhclient/utils.py
+++ b/aodhclient/utils.py
@@ -21,25 +21,25 @@ binary_operator = (">=", "<=", "!=", ">", "<", "=", "==", "eq", "ne",
 multiple_operators = ("and", "or")
 
 operator = pp.Regex("|".join(binary_operator))
-null = pp.Regex("None|none|null").setParseAction(pp.replaceWith(None))
+null = pp.Regex("None|none|null").set_parse_action(pp.replace_with(None))
 boolean = "False|True|false|true"
-boolean = pp.Regex(boolean).setParseAction(lambda t: t[0].lower() == "true")
+boolean = pp.Regex(boolean).set_parse_action(lambda t: t[0].lower() == "true")
 hex_string = lambda n: pp.Word(pp.hexnums, exact=n)  # noqa: E731
 uuid = pp.Combine(hex_string(8) + ("-" + hex_string(4)) * 3 +
                   "-" + hex_string(12))
 number = r"[+-]?\d+(:?\.\d*)?(:?[eE][+-]?\d+)?"
-number = pp.Regex(number).setParseAction(lambda t: float(t[0]))
+number = pp.Regex(number).set_parse_action(lambda t: float(t[0]))
 identifier = pp.Word(pp.alphas, pp.alphanums + "_")
 quoted_string = pp.QuotedString('"') | pp.QuotedString("'")
 comparison_term = pp.Forward()
 in_list = pp.Group(pp.Suppress('[') +
-                   pp.Optional(pp.delimitedList(comparison_term)) +
+                   pp.Optional(pp.DelimitedList(comparison_term)) +
                    pp.Suppress(']'))("list")
 comparison_term << (null | boolean | uuid | identifier | number |
                     quoted_string)
 condition = pp.Group(comparison_term + operator + comparison_term)
 
-expr = pp.infixNotation(condition, [
+expr = pp.infix_notation(condition, [
     ("not", 1, pp.opAssoc.RIGHT, ),
     ("and", 2, pp.opAssoc.LEFT, ),
     ("or", 2, pp.opAssoc.LEFT, ),
@@ -73,9 +73,9 @@ def _parsed_query2dict(parsed_query):
         elif part in uninary_operators:
             result = {part: result}
         elif isinstance(part, pp.ParseResults):
-            kind = part.getName()
+            kind = part.get_name()
             if kind == "list":
-                res = part.asList()
+                res = part.as_list()
             else:
                 res = _parsed_query2dict(part)
             if result is None:
@@ -88,7 +88,7 @@ def _parsed_query2dict(parsed_query):
 
 
 def search_query_builder(query):
-    parsed_query = expr.parseString(query)[0]
+    parsed_query = expr.parse_string(query)[0]
     return _parsed_query2dict(parsed_query)
 
 
diff --git a/requirements.txt b/requirements.txt
index d40f6f2..7e6559e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,4 +10,4 @@ oslo.serialization>=1.4.0 # Apache-2.0
 oslo.utils>=2.0.0 # Apache-2.0
 osprofiler>=1.4.0 # Apache-2.0
 keystoneauth1>=1.0.0
-pyparsing>2.1.0 # MIT
+pyparsing>3.0.0 # MIT
-- 
2.53.0

Reply via email to