Skip to content

adjust path for GIL Refs deprecation warnings#3968

Merged
davidhewitt merged 2 commits intoPyO3:mainfrom
davidhewitt:gil-ref-warnings
Mar 19, 2024
Merged

adjust path for GIL Refs deprecation warnings#3968
davidhewitt merged 2 commits intoPyO3:mainfrom
davidhewitt:gil-ref-warnings

Conversation

@davidhewitt
Copy link
Member

I noticed that the UI tests are emitting warnings like

error: use of deprecated method `pyo3::methods::Extractor::<T>::extract_gil_ref`: use `&Bound<'_, T>` instead for this function argument

That pyo3::methods path bothered me as I want to deprecate that module (probably a 0.22 thing at this point). I thought we might be able to get something more meaningful, so I shuffled code around a little. Now we get:

error: use of deprecated method `pyo3::deprecations::GilRefs::<T>::extract_gil_ref`: use `&Bound<'_, T>` instead for this function argument

Do folks think this is any nicer? Think we can make the path even better for readers?

cc @Icxolu as this probably will have merge conflicts with code you're typing 😬

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Mar 18, 2024
@Icxolu
Copy link
Contributor

Icxolu commented Mar 18, 2024

In my opinion this does look nicer, and separating the construct used purely for deprecation warnings makes sense, so that we can easily find them when it's finally time to remove the, again.

@davidhewitt
Copy link
Member Author

Great! I'll rebase this once #3967 goes in and get this merged 👍

(Probably first thing in the morning now.)

@davidhewitt davidhewitt enabled auto-merge March 19, 2024 19:10
@davidhewitt davidhewitt added this pull request to the merge queue Mar 19, 2024
Merged via the queue into PyO3:main with commit 02e188e Mar 19, 2024
@davidhewitt davidhewitt deleted the gil-ref-warnings branch March 19, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-skip-changelog Skip checking changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants