Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration to pyo3 0.21 new Bound API #410

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

Icxolu
Copy link
Contributor

@Icxolu Icxolu commented Mar 6, 2024

pyo3 0.21 is on the final stretch to release, with an initial beta expected in the next few days.

This starts the migration to pyo3s new Bound API. This initial PR bumps the pyo3 version, enables the gil-refs feature (to suppress most of the deprecation warnings) and adjust the rest to compile and pass the tests again.

Note:
PyTypeInfo needs to be updated to is_type_of_bound now, because otherwise pyo3s internals will not use the custom implementation, as found in PyO3/pyo3#3929

I've prepared followups migrating different parts of the API in (hopefully) reviewable chunks. Generally I took a similar approach to pyo3 itself, leaving old API around (for easy migrations) and adding deprecation warnings where necessary.

I'll leave this as a draft until the beta release drops and rebase this than.

src/array_like.rs Outdated Show resolved Hide resolved
src/borrow/shared.rs Outdated Show resolved Hide resolved
@Icxolu Icxolu force-pushed the bound-api-initial branch 2 times, most recently from d81b846 to 0cfc921 Compare March 10, 2024 22:27
@Icxolu Icxolu marked this pull request as ready for review March 10, 2024 22:59
@Icxolu
Copy link
Contributor Author

Icxolu commented Mar 10, 2024

Rebased to use pyo3 0.21.0-beta, bumped examples to also use it and fixed MSRV

Copy link
Member

@adamreichold adamreichold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for bringing rust-numpy up to speed. Hope we'll be able to work through supporting the Bound API and NumPy 2 at the same time without too much toe stepping.

This does still use GIL Refs in numpy's API but switches
our internals to use the Bound API where appropriate.
@adamreichold adamreichold merged commit 744a3f3 into PyO3:main Mar 11, 2024
34 of 35 checks passed
@Icxolu Icxolu deleted the bound-api-initial branch March 11, 2024 17:41
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.

2 participants