-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Do not emit compiler warning if forcing old API #12286
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
Conversation
I'm trying to recall who needs this at this time. |
Anyone who want to avoid the warning needs to define |
I need it for PR #12284 for |
+1 for hiding this warning. Whoever hasn't upgraded yet after 10 releases won't do so anymore because of this warning, so it's just a lot of noise now. |
Ah tested and still seeing it - I thought the intent was never to show this warning anymore. I'd be fine with that. |
Any more comments? Can I merge? |
It might be nice to paraphrase @rgommers comment beside the While it's true that ignoring it for 10 releases probably means downstream users will continue to do so, I'm not sure I see the argument for saving those users from noise. Can you elaborate on why this warning needs to go away for cython compatibility?
I assume you mean remove completely |
This PR will change the current behaviour to not emit a warning if the user explicitly requests an API version. |
Added a comment to the header |
Don't see a problem with this, especially if it helps Cython in the short term. I guess the other option is to disable the warning entirely, and we can maybe do that at some point. Another option is to make it explicit,
|
Thanks Matti. |
If a user does not define
NPY_NO_DEPRECATED_API
, we emit a warning encouraging them to choose an api version. If they chooseNPY_1_7_API_VERSION
or earlier, we include a special header with many old API interfaces. This is still needed for correct operation with cython, see cython/cython#2640 for a possible solution. Until we can truly deprecate the old APIs (or decide to revert the deprecation), choosing the old API should not emit a compiler warning.