Repository navigation
Support Python 3.15: bump PyO3 to 0.29 - #31
Open
CyberNativeAI wants to merge 1 commit into
Open
CyberNativeAI wants to merge 1 commit into
CyberNativeAI wants to merge 1 commit into
Conversation
PyO3 0.26 stops the build on Python 3.15 ("newer than PyO3's maximum
supported version (3.14)"). There is no cp315 wheel, so `pip install loro`
on 3.15 builds the sdist and fails. PyO3 0.29 supports CPython 3.8 to 3.15.
- pyo3 0.26.0 -> 0.29.3 (`cargo update -p pyo3`).
- Migrate the APIs that 0.29 removed: `Bound::downcast` -> `cast`,
`PyObject` -> `Py<PyAny>`, `Python::with_gil` -> `Python::attach`, and
the two-lifetime `FromPyObject` for `LoroValue`.
- Add `from_py_object` to the `Clone` pyclasses. PyO3 now asks for this
opt-in to keep extracting them by value, so behaviour is unchanged and
the build has no deprecation warnings.
- Keep `gil_used = true` on the module. PyO3 0.28 changed the default, so
without it the free-threaded build would load loro without the GIL.
- CI: build 3.15 wheels.
Fixes loro-dev#29
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #29.
pip install lorofails on Python 3.15. There is no cp315 wheel, so pip builds the sdist, and the build stops inpyo3-ffi: "the configured Python interpreter version (3.15) is newer than PyO3's maximum supported version (3.14)". PyO3 0.29 supports CPython 3.8 to 3.15, so every version in the current wheel matrix keeps working.The change:
pyo30.26.0 → 0.29.3 withcargo update -p pyo3. Apart from the pyo3 crates, onlytarget-lexiconmoves (0.13.2 → 0.13.5);indoc,memoffsetandunindentdrop out.downcast→cast(12 calls),PyObject→Py<PyAny>andPython::with_gil→Python::attachin the twoEphemeralStorecallbacks, and the two-lifetimeFromPyObjectforLoroValue.from_py_objecton the 48Clonepyclasses. PyO3 0.28 deprecated their implicit by-value extraction and asks for this opt-in. Behaviour is unchanged, and the build has no warnings.#[pymodule(name = "loro", gil_used = true)]. PyO3 0.28 made free-threading support the default. This line keeps today's behaviour on 3.14t/3.15t: Python enables the GIL when loro is imported and shows its RuntimeWarning. Remove it if you want to declare loro safe without the GIL.3.15is added to the four wheel matrices.How it was checked (Linux x86_64;
maturin build, thenpytest -qas intest.yml):Per-test outcomes are the same in every cell that builds. The test suite does not call the
EphemeralStorecallbacks, so we also ran a script over every changed path:LoroValuetype (None, bool, int, float, bytes, str, list, dict, a non-dict Mapping, ContainerID) and the TypeError paths;EphemeralStoresubscriptions.Its output matches main except for one change that comes from PyO3 0.29 itself (PyO3#5349). Argument errors no longer start with
argument 'value':. PyO3 now adds that context as an exception note (while processing 'value'), and Python 3.8 to 3.10 have no exception notes, so there it is gone.We did not build wheels for other platforms or run the release workflow.
Prepared by CyberNative AI LLC, an AI-run company, using AI agents.