Skip to content

Commit 5f9b38d

Browse files
authored
Release/0.5.0 (#8)
* documentation updates * Add version retrieval and display option to CLI * bump version to 0.5.0
1 parent d27116a commit 5f9b38d

18 files changed

+1176
-507
lines changed

CHANGELOG.md

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
### Changed
11-
- **BREAKING**: Updated `cel` crate (formerly `cel-interpreter`) from 0.10.0 to 0.11.0
12-
- Crate renamed from `cel-interpreter` to `cel` upstream
13-
- API changes to function registration system using `IntoFunction` trait
14-
- Python function integration now uses `Arguments` extractor for variadic argument handling
15-
- All imports updated from `cel_interpreter::` to `::cel::`
1610

17-
### Dependencies Updated
18-
- cel-interpreter → cel: 0.10.0 → 0.11.0 (crate renamed, major API breaking changes)
19-
- New function registration system using `IntoFunction` trait
20-
- Improved extractors system with `Arguments`, `This`, and `Identifier`
21-
- Better error handling and performance improvements
22-
- pyo3: 0.25.0 → 0.25.1 (latest stable)
23-
- pyo3-log: 0.12.1 → 0.12.4 (latest compatible version)
11+
## [0.5.0] - 2025-08-08
2412

25-
### Notes
26-
- **CEL v0.11.0 Integration**: Updated to new `IntoFunction` trait system while maintaining full Python API compatibility
27-
- All Python functions still work identically from user perspective
28-
- Internal implementation now uses `Arguments` extractor for better performance
29-
- No breaking changes to Python API - all existing code continues to work
30-
- **Future-Proofing**: Analysis of upcoming cel-rust changes shows exciting developments:
31-
- Enhanced type system infrastructure for better type introspection
32-
- Foundation for `type()` function (currently missing from CEL spec compliance)
33-
- Optional value infrastructure for safer null handling
34-
- All future changes maintain backward compatibility with our wrapper
13+
### 🚨 Breaking Changes (Rust API only)
14+
- Upgraded `cel` crate (formerly `cel-interpreter`) 0.10.0 → 0.11.0:
15+
- Function registration now uses `IntoFunction` trait.
16+
- Python integration updated to use `Arguments` extractor for variadic args.
17+
- Imports renamed from `cel_interpreter::` to `cel::`.
18+
- **No changes to Python API** – all existing code continues to work.
3519

36-
## [0.4.1] - 2025-08-02
20+
### ✨ Changed
21+
- Internal: Refactored Python integration to match new CEL API.
22+
- Updated dependencies:
23+
- pyo3: 0.25.0 → 0.25.1
24+
- pyo3-log: 0.12.1 → 0.12.4
25+
26+
### 🗒 Maintainer Notes
27+
- Prepared for upcoming CEL Rust features:
28+
- Enhanced type system & introspection
29+
- `type()` function support
30+
- Optional value handling
3731

38-
### Added
39-
- **Automatic Type Coercion**: Intelligent preprocessing of expressions to handle mixed int/float arithmetic
40-
- Expressions with float literals automatically convert integer literals to floats
41-
- Context variables containing floats trigger integer-to-float promotion for compatibility
42-
- Preserves array indexing with integers (e.g., `list[2]` remains as integer)
43-
- **Enhanced Error Handling**: Added panic handling with `std::panic::catch_unwind` for parser errors
44-
- Invalid expressions now return proper ValueError instead of crashing the Python process
45-
- Graceful handling of upstream parser panics from cel-interpreter
32+
## [0.4.1] - 2025-08-02
4633

47-
### Changed
48-
- Updated `cel-interpreter` from 0.9.0 to 0.10.0
34+
### ✨ Added
35+
- **Automatic type coercion** for mixed int/float arithmetic:
36+
- Float literals automatically promote integer literals to floats.
37+
- Context variables containing floats trigger int → float promotion.
38+
- Preserves array indexing with integers (e.g., `list[2]` stays integer).
39+
- **Enhanced error handling**:
40+
- Parser panics now caught with `std::panic::catch_unwind`.
41+
- Invalid expressions return a `ValueError` instead of crashing Python.
4942

50-
### Fixed
51-
- **Mixed-type arithmetic compatibility**: Expressions like `3.14 * 2`, `2 + 3.14`, `value * 2` (where value is float) now work as expected
52-
- **Parser panic handling**: Implemented `std::panic::catch_unwind` to gracefully handle upstream parser panics
53-
- Users get proper error messages instead of application crashes
54-
- Fixed deprecation warnings by updating to compatible PyO3 APIs
43+
### 🐛 Fixed
44+
- Mixed-type arithmetic now works in expressions like:
45+
- `3.14 * 2`
46+
- `2 + 3.14`
47+
- `value * 2` (where `value` is float)
48+
- Parser panics from `cel-interpreter` handled gracefully with proper error messages.
49+
- Updated to latest PyO3 APIs to remove deprecation warnings.
5550

56-
### Known Issues
57-
- **Bytes Concatenation**: cel-interpreter 0.10.0 does not implement bytes concatenation with `+` operator
58-
- **CEL specification requires**: `b'hello' + b'world'` should work
59-
- **Current behavior**: Returns "Unsupported binary operator 'add'" error
60-
- **Workaround**: Use `bytes(string(part1) + string(part2))` for concatenation
61-
- **Status**: This is a missing feature in the cel-interpreter crate, not a design limitation
51+
### Known Issues
52+
- **Bytes concatenation** (`b'hello' + b'world'`) unsupported in cel-interpreter 0.10.0.
53+
- **Spec requires**: should work.
54+
- **Current**: returns `"Unsupported binary operator 'add'"`.
55+
- **Workaround**: `bytes(string(part1) + string(part2))`.
56+
- **Status**: Missing feature in cel-interpreter, not in our wrapper.
6257

63-
### Dependencies Updated
64-
- cel-interpreter: 0.9.0 → 0.10.0 (major version update with breaking changes)
58+
### 📦 Dependencies
59+
- cel-interpreter: 0.9.0 → 0.10.0 (breaking changes internally)
6560
- log: 0.4.22 → 0.4.27
6661
- chrono: 0.4.38 → 0.4.41
67-
- pyo3: 0.22.6 → 0.25.0 (major API upgrade with IntoPyObject migration)
68-
- pyo3-log: 0.11.0 → 0.12.1 (compatible with pyo3 0.25.0)
62+
- pyo3: 0.22.6 → 0.25.0 (major API upgrade to `IntoPyObject`)
63+
- pyo3-log: 0.11.0 → 0.12.1 (compatible with PyO3 0.25.0)
6964

70-
### Notes
71-
- **PyO3 0.25.0 Migration**: Migrated from deprecated `IntoPy` trait to new `IntoPyObject` API
72-
- **API Improvements**: New conversion system provides better error handling and type safety
73-
- **Build Status**: All 120 tests pass with current dependency versions
65+
### 🗒 Maintainer Notes
66+
- **PyO3 migration**: moved from deprecated `IntoPy` to new `IntoPyObject` API.
67+
- New conversion system improves error handling and type safety.
68+
- All 120 tests pass on current dependency set.
7469

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cel"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

docs/contributing.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,20 @@ cd python-common-expression-language
5555

5656
# Install development dependencies
5757
uv sync --dev
58+
# → Installing project dependencies and development tools
5859

5960
# Build the Rust extension
6061
uv run maturin develop
62+
# → 🔗 Found pyo3 bindings
63+
# → 📦 Built wheel for CPython 3.11 to target/wheels/common_expression_language-0.11.0-cp311-cp311-linux_x86_64.whl
64+
# → 📦 Installed common-expression-language-0.11.0
6165

6266
# Run tests to verify setup
6367
uv run pytest
68+
# → ========================= test session starts =========================
69+
# → collected 300+ items
70+
# → tests/test_basics.py ........ [ 95%]
71+
# → ========================= 300 passed in 2.34s =========================
6472
```
6573

6674
### Code Organization
@@ -87,15 +95,34 @@ We maintain comprehensive test coverage across multiple categories:
8795
```bash
8896
# Run all tests
8997
uv run pytest
98+
# → ========================= test session starts =========================
99+
# → collected 300+ items
100+
# → tests/test_basics.py ........ [ 95%]
101+
# → ========================= 300 passed in 2.34s =========================
90102

91103
# Run specific test categories
92104
uv run pytest tests/test_basics.py # Core functionality
105+
# → ========================= 25 passed in 0.12s =========================
106+
93107
uv run pytest tests/test_arithmetic.py # Math operations
108+
# → ========================= 42 passed in 0.18s =========================
109+
94110
uv run pytest tests/test_context.py # Variable handling
111+
# → ========================= 18 passed in 0.09s =========================
112+
95113
uv run pytest tests/test_upstream_improvements.py # Future compatibility
114+
# → ========================= 15 passed, 8 xfailed in 0.15s =========================
96115

97116
# Run with coverage
98117
uv run pytest --cov=cel
118+
# → ========================= test session starts =========================
119+
# → ----------- coverage: platform linux, python 3.11.0-final-0 -----------
120+
# → Name Stmts Miss Cover
121+
# → ------------------------------------------
122+
# → cel/__init__.py 12 0 100%
123+
# → ------------------------------------------
124+
# → TOTAL 12 0 100%
125+
# → ========================= 300 passed in 3.45s =========================
99126
```
100127

101128

@@ -123,11 +150,14 @@ def test_lower_ascii_not_implemented(self):
123150
"""When this test starts failing, lowerAscii() has been implemented."""
124151
with pytest.raises(RuntimeError, match="Undefined variable or function.*lowerAscii"):
125152
cel.evaluate('"HELLO".lowerAscii()')
153+
# → RuntimeError: Undefined variable or function 'lowerAscii'
126154

127155
@pytest.mark.xfail(reason="String utilities not implemented in cel v0.11.0", strict=False)
128156
def test_lower_ascii_expected_behavior(self):
129157
"""This test will pass when upstream implements lowerAscii()."""
130-
assert cel.evaluate('"HELLO".lowerAscii()') == "hello"
158+
result = cel.evaluate('"HELLO".lowerAscii()')
159+
# → "hello" (when implemented)
160+
assert result == "hello"
131161
```
132162

133163
#### Monitored Categories
@@ -146,9 +176,15 @@ def test_lower_ascii_expected_behavior(self):
146176
```bash
147177
# Check current upstream compatibility status
148178
uv run pytest tests/test_upstream_improvements.py -v
179+
# → test_lower_ascii_not_implemented PASSED
180+
# → test_lower_ascii_expected_behavior XFAIL
181+
# → test_type_function_not_implemented PASSED
182+
# → test_type_function_expected_behavior XFAIL
183+
# → ========================= 15 passed, 8 xfailed in 0.15s =========================
149184

150185
# Look for XPASS results indicating new capabilities
151186
uv run pytest tests/test_upstream_improvements.py -v --tb=no | grep -E "(XPASS|FAILED)"
187+
# → (no output means no unexpected passes - all limitations still exist)
152188
```
153189

154190
**Interpreting Results:**
@@ -218,35 +254,60 @@ def add_function(self, name: str, func: Callable) -> None:
218254
```bash
219255
# Clean rebuild
220256
uv run maturin develop --release
257+
# → 🔗 Found pyo3 bindings
258+
# → 📦 Built wheel for CPython 3.11 to target/wheels/common_expression_language-0.11.0-cp311-cp311-linux_x86_64.whl
259+
# → 📦 Installed common-expression-language-0.11.0
221260

222261
# Check Rust toolchain
223262
rustc --version
263+
# → rustc 1.75.0 (82e1608df 2023-12-21)
264+
224265
cargo --version
266+
# → cargo 1.75.0 (1d8b05cdd 2023-11-20)
225267
```
226268

227269
**Test Failures:**
228270
```bash
229271
# Run with verbose output
230272
uv run pytest tests/test_failing.py -v -s
273+
# → ========================= test session starts =========================
274+
# → tests/test_failing.py::test_function FAILED
275+
# → ===================== short test summary info =====================
276+
# → FAILED tests/test_failing.py::test_function - AssertionError: ...
231277

232278
# Debug specific test
233279
uv run pytest tests/test_file.py::test_name --pdb
280+
# → ========================= test session starts =========================
281+
# → >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
282+
# → (Pdb)
234283
```
235284

236285
**Type Conversion Issues:**
237286
```bash
238287
# Check Python-Rust boundary
239288
uv run pytest tests/test_types.py -v --tb=long
289+
# → ========================= test session starts =========================
290+
# → tests/test_types.py::test_string_conversion PASSED
291+
# → tests/test_types.py::test_int_conversion PASSED
292+
# → tests/test_types.py::test_list_conversion PASSED
293+
# → ========================= 25 passed in 0.12s =========================
240294
```
241295

242296
### Performance Profiling
243297

244298
```bash
245299
# Basic performance verification
246300
uv run pytest tests/test_performance_verification.py
301+
# → ========================= test session starts =========================
302+
# → tests/test_performance_verification.py::test_basic_performance PASSED
303+
# → tests/test_performance_verification.py::test_bulk_evaluations PASSED
304+
# → ========================= 5 passed in 0.45s =========================
247305

248306
# Memory profiling (if needed)
249307
uv run pytest --profile tests/test_performance.py
308+
# → ========================= test session starts =========================
309+
# → Profiling enabled, results saved to .pytest_cache/profiling/
310+
# → ========================= 12 passed in 1.23s =========================
250311
```
251312

252313
## Release Process

0 commit comments

Comments
 (0)