ENH: Do not emit compiler warning if forcing old API#12286
ENH: Do not emit compiler warning if forcing old API#12286charris merged 1 commit intonumpy:masterfrom
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_VERSIONor 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.