Skip to content

Commit 4d3c769

Browse files
Upgrade cel-python to 0.5.0 (#414)
With cloud-custodian/cel-python#113 fixed, we're able to upgrade. (I plan to release a `1.1.1` after merging this.) Ref: https://github.com/cloud-custodian/cel-python/releases/tag/v0.5 Fixes #382.
1 parent 48a8eaf commit 4d3c769

3 files changed

Lines changed: 88 additions & 258 deletions

File tree

protovalidate/internal/cel_field_presence.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import threading
1616

1717
import celpy
18+
import celpy.celtypes
1819

1920
_has_state = threading.local()
2021

@@ -32,14 +33,14 @@ def in_has() -> bool:
3233

3334

3435
class InterpretedRunner(celpy.InterpretedRunner):
35-
def evaluate(self, context):
36+
def evaluate(self, context) -> celpy.celtypes.Value:
3637
class Evaluator(celpy.Evaluator):
37-
def macro_has_eval(self, exprlist):
38+
def macro_has_eval(self, exprlist) -> celpy.celtypes.BoolType:
3839
_has_state.in_has = True
3940
result = super().macro_has_eval(exprlist)
4041
_has_state.in_has = False
4142
return result
4243

43-
e = Evaluator(ast=self.ast, activation=self.new_activation(context), functions=self.functions)
44-
value = e.evaluate()
44+
e = Evaluator(ast=self.ast, activation=self.new_activation())
45+
value = e.evaluate(context)
4546
return value

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
dynamic = ["version"]
2424
dependencies = [
2525
"protobuf>=5",
26-
"cel-python==0.2.*",
26+
"cel-python>=0.5",
2727
# We need at least this version, which started publishing wheels for Python 3.14.
2828
# Ref: https://github.com/google/re2/issues/580
2929
"google-re2>=1.1.20251105; python_version == '3.14'",

0 commit comments

Comments
 (0)