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

Remove 0.17 deprecations #2981

Merged
merged 5 commits into from May 9, 2023
Merged

Conversation

davidhewitt
Copy link
Member

Since #2980 starts a breaking change for 0.19, let's also clean up all 0.17's deprecations.

I've removed Python::acquire_gil in its own commit, as that was a reasonably chunky removal.

src/gil.rs Outdated Show resolved Hide resolved
Copy link
Member

@mejrs mejrs left a comment

Choose a reason for hiding this comment

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

I was thinking about keeping acquire_gil around for a while longer, because I think a lot of people still use it, and maybe use it in ways that aren't trivial to rewrite using with_gil. That said I also don't like having both around, so 👍 to this.

@adamreichold
Copy link
Member

I was thinking about keeping acquire_gil around for a while longer, because I think a lot of people still use it, and maybe use it in ways that aren't trivial to rewrite using with_gil. That said I also don't like having both around, so +1 to this.

I think this would be worth it considering how much tricky/unsafe code can be removed or get reduced visibility due to this, especially the drop order checking which could inject unexpected and intermittent panics into downstream code.

@davidhewitt
Copy link
Member Author

I think what I'll do is add a migration guide entry for removal of Python::acquire_gil, so that it's easier for users to understand what happened and how to change it.

@adamreichold
Copy link
Member

@davidhewitt I would like to help here if I can as I would very much like to see this merged for the reduction in complexity it allows. Would you mind if I tried to rebase this and add another commit for the migration guide entry?

@davidhewitt
Copy link
Member Author

Please do, at the moment when I get a scrap of time I'm trying to finish off #3029

@adamreichold
Copy link
Member

I added an entry to the migration guide but admittedly the example is quite artificial. Please have a look and let me know if this is sufficient for our purposes.

Copy link
Member Author

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Looks great to me, I agree it's artificial though it clearly demonstrates what a problematic pattern might be and how Python::with_gil would be used instead.

guide/src/migration.md Outdated Show resolved Hide resolved
@adamreichold
Copy link
Member

bors r=adamreichold,davidhewitt

@bors
Copy link
Contributor

bors bot commented May 9, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 7b443cf into PyO3:main May 9, 2023
33 checks passed
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.

None yet

3 participants