Skip to content

Conversation

@vigith
Copy link
Member

@vigith vigith commented Nov 23, 2025

Migration Guide https://pyo3.rs/v0.27.0/migration.html

  • lifetime changes
  • explicit conversion to PyErr
  • downcast is deprecated
(pynumaflow-lite) ➜  pynumaflow-lite git:(pyo3-upgrade) ✗ make test
maturin develop
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
🐍 Found CPython 3.13 at /Users/vigith/code/git/numaproj/numaflow-python/packages/pynumaflow-lite/.venv/bin/python
📡 Using build options features from pyproject.toml
   Compiling pynumaflow-lite v0.1.0 (/Users/vigith/code/git/numaproj/numaflow-python/packages/pynumaflow-lite)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.85s
📦 Built wheel for CPython 3.13 to /var/folders/9v/ztc8jgrn1b9dvwd5sv1z0ndh0000gp/T/.tmpQ1lWW0/pynumaflow_lite-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
✏️ Setting installed package as editable
🛠 Installed pynumaflow-lite-0.1.0
pytest -v
================================================================================================= test session starts =================================================================================================
platform darwin -- Python 3.13.2, pytest-8.4.2, pluggy-1.6.0 -- /Users/vigith/code/git/numaproj/numaflow-python/packages/pynumaflow-lite/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/vigith/code/git/numaproj/numaflow-python/packages/pynumaflow-lite
configfile: pyproject.toml
collected 13 items

tests/test_accumulator.py::test_python_accumulator_server_and_rust_client[accumulator_stream_sorter.py] PASSED                                                                                                  [  7%]
tests/test_batchmap.py::test_python_batch_server_and_rust_client[batchmap_cat.py] PASSED                                                                                                                        [ 15%]
tests/test_batchmap.py::test_python_batch_server_and_rust_client[batchmap_cat_class.py] PASSED                                                                                                                  [ 23%]
tests/test_map.py::test_python_server_and_rust_client[map_cat.py] PASSED                                                                                                                                        [ 30%]
tests/test_map.py::test_python_server_and_rust_client[map_cat_class.py] PASSED                                                                                                                                  [ 38%]
tests/test_mapstream.py::test_python_stream_server_and_rust_client[mapstream_cat.py] PASSED                                                                                                                     [ 46%]
tests/test_mapstream.py::test_python_stream_server_and_rust_client[mapstream_cat_class.py] PASSED                                                                                                               [ 53%]
tests/test_reduce.py::test_python_reduce_server_and_rust_client[reduce_counter_class.py] PASSED                                                                                                                 [ 61%]
tests/test_reduce.py::test_python_reduce_server_and_rust_client[reduce_counter_func.py] PASSED                                                                                                                  [ 69%]
tests/test_session_reduce.py::test_python_session_reduce_server_and_rust_client[session_reduce_counter_class.py] PASSED                                                                                         [ 76%]
tests/test_sink.py::test_python_sink_server_and_rust_client[sink_log.py] PASSED                                                                                                                                 [ 84%]
tests/test_sink.py::test_python_sink_server_and_rust_client[sink_log_class.py] PASSED                                                                                                                           [ 92%]
tests/test_source.py::test_python_source_server_and_rust_client[source_simple.py] PASSED                                                                                                                        [100%]

================================================================================================= 13 passed in 42.63s =================================================================================================```

Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
@vigith vigith requested review from ab93 and whynowy as code owners November 23, 2025 18:00
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.85%. Comparing base (b0c7e7b) to head (03caeb3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #286   +/-   ##
=======================================
  Coverage   93.85%   93.85%           
=======================================
  Files          66       66           
  Lines        3009     3009           
  Branches      155      155           
=======================================
  Hits         2824     2824           
  Misses        135      135           
  Partials       50       50           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vigith vigith requested a review from BulkBeing November 23, 2025 18:03
@vigith
Copy link
Member Author

vigith commented Nov 23, 2025

lifetime changes are due we supporting 3.14 which can optionally not use Python GIL

The two lifetimes are separate:
'a can be shorter than 'py (borrow from temporary input)
'a can be longer than 'py (borrow data that outlives the Python attachment)

@vigith vigith merged commit cf047af into main Nov 24, 2025
13 checks passed
@vigith vigith deleted the pyo3-upgrade branch November 24, 2025 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants