Skip to content

Re-enable dill-based state fallback pickling on Python 3.15 once dill#753 is released #7147

Description

@masenf

Follow-up to #6930 (Python 3.15 support).

dill <= 0.4.1 cannot serialize functions on Python 3.15 (it uses code.co_lnotab, removed in 3.15): uqfoundation/dill#753. As of today, 0.4.1 is still the latest release on PyPI, so #6930 marked the affected tests instead of fixing anything in Reflex:

  • tests/units/test_state.py::test_fallback_pickle@pytest.mark.xfail(sys.version_info >= (3, 15), raises=StateSerializationError)
  • tests/integration/test_dynamic_components.py::test_dynamic_components@pytest.mark.skipif(sys.version_info >= (3, 15) and bool(os.environ.get("REFLEX_REDIS_URL")))

Note this is not test-only fallout: on Python 3.15 with redis state, any state that needs the dill fallback (e.g. a Callable field, dynamic components) fails to serialize at runtime.

When a dill release fixing uqfoundation/dill#753 is out:

  1. Bump dill in uv.lock (uv lock --upgrade-package dill).
  2. Drop both markers and the accompanying TODO comments.
  3. Confirm test_fallback_pickle and the redis-backed test_dynamic_components pass on 3.15.
  4. Consider raising the declared minimum dill version so downstream users on 3.15 get the fix instead of a runtime serialization error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions