Repository navigation
Releases
Releases · cel-expr/cel-python
Release 0.1.4
Release notes for CEL Python (cel-expr-python) version 0.1.4
Key Highlights
- Lists Extension Library (
ext_lists): Added bindings for the standard CELlistsextension library (cel_expr_python.ext.ext_lists.ExtLists()), providing functions such aslists.range(),slice(),flatten(),distinct(),reverse(), andsort(). - Python 3.10 & Free-Threaded Python Support: Expanded wheel compatibility to include Python 3.10 (alongside 3.11–3.14) and enabled free-threaded Python (
Py_GIL_DISABLED) support with multi-threaded compilation and evaluation concurrency improvements. - Pratt Parser Enabled by Default & Environment Options: Added
cel.Options(passed viacel.NewEnv(options=...)) and enabled the CEL Pratt parser (enable_pratt_parser=True) by default:
from cel_expr_python import cel
from cel_expr_python.ext import ext_lists
env: cel.Env = cel.NewEnv(
extensions=[ext_lists.ExtLists()],
options=cel.Options(enable_pratt_parser=True),
)
res: cel.Value = env.compile("lists.range(4)").eval()- Stability & Packaging Improvements:
- Upgraded
cel-cpptov0.17.0and updatedcel-specconformance coverage. - Resolved AB-BA deadlocks between the Python GIL and C++
DescriptorPool/ runtime mutexes during multi-threaded compilation and evaluation. - Ensured evaluated
cel.Valueinstances safely outlivecel.Expressionby cloning values onto the evaluation arena. - Hardened PyPI wheel packaging to include
.pyitype stubs for all extension modules while excluding test files.
- Upgraded
Full Changelog: v0.1.3...v0.1.4
Release 0.1.3
Release notes for CEL Python (cel-expr-python) version 0.1.3
Key Highlights
- Platform Compatibility Expansion: Added support for linux/arm64, macos/x86 and the following versions of Python: 3.11, 3.12, 3.13 and 3.14 for all supported platforms.
- YAML configuration parser: Added support for YAML-formatted CEL environment configuration:
config: cel.EnvConfig = cel.NewEnvConfigFromYaml("""
variables:
- name: two
type: int
value: 2
extensions:
- name: math
- name: strings
""")
env: cel.Env = cel.NewEnv(config=config)
res: cel.Value = env.compile("'%.4f'.format([math.sqrt(two)])").eval()Full Changelog: v0.1.2...v0.1.3
Release 0.1.2
Release notes for CEL Python (cel-expr-python) version 0.1.2
Key Highlights
- Platform Compatibility Expansion: Initial support for Microsoft Windows and macOS environments, complete with dedicated CI/CD presubmit pipelines and automated wheel releases using
cibuildwheel. - Expression Container Aliases & Abbreviations: Added support for namespace resolution in the environment via the new
cel.ExpressionContainerclass. - Simplified User-defined Functions: Enabled registration of custom functions written in Python directly via
cel.NewEnv(functions=[...]). - Type Stub Annotations (
.pyi): Added robust inline type stubs for improved IDE auto-completion and static type checking.
Detailed Change Log
1. Multi-Platform & Build Infrastructure Support
- Windows Support: Added Microsoft Windows build support. Configured modern C++ standards compilation (
/std:c++20) for MSVC compiler. - macOS Support: Configured Apple macOS build pipeline.
- cibuildwheel Optimization: Updated release scripts to support Python 3.11, 3.12, 3.13, and 3.14 wheel compiles.
2. Namespace Resolution (cel.ExpressionContainer)
- Container Aliases: Added
cel.ExpressionContainerclass to pass tocel.NewEnv(container=...). Allows binding aliases to fully qualified names (e.g.,aliases={"abc": "x.y.bar"}) and defining namespace abbreviations.
3. Custom Functions Declarations
cel.FunctionDecl&cel.Overload: Added dedicated classes for custom function binding. You can now define custom behaviors and overload resolutions in Python:cel_env = cel.NewEnv( functions=[ cel.FunctionDecl("hello", [ cel.Overload("hello(string)", cel.Type.STRING, [cel.Type.STRING], impl=lambda x: f"Hello {x}!") ]) ] )
- Separate Implementation Binding: Supported binding overloads dynamically using
NewEnv(functions=[...], function_impls={"overload_id": handler}).
4. Extension Changes & Refactoring
ext_stringsRenaming: Renamed Python strings extension fromext_stringtoext_stringsto align with internal conventions.- Compiler Library Migration: Refactored C++ extension interface from using
ConfigureCompilerto returningcel::CompilerLibraryviaGetCompilerLibrary(), harmonizing between standard and custom extension definitions.
Full Changelog: v0.1.1...0.1.2---
Initial release of CEL-expr-python
Initial release of CEL-expr-python, wrapper over CEL-C++
Features:
- Compilation
- Evaluation of a type-checked expression
- Support for Protobuf
- Standard extensions: math, strings, optional, bindings etc
- Support for custom extensions, written in Python or C++