MAINT: disable Cython bindings for Cython < 3.0.0.#30770
MAINT: disable Cython bindings for Cython < 3.0.0.#30770ngoldbaum merged 7 commits intonumpy:mainfrom
Conversation
375346f to
9d75476
Compare
|
@da-woods I'm curious about your opinion on this. Is there a better way to drop support for building against the NumPy headers and older Cython versions that you might use instead of this? |
I think this is fine. But if I did it then I'd probably delete all of The other thing you could do is to use With that said, I don't think Cython 0.29 would successfully compile the 3.0 pxd file so you might not even get far enough for people to see the error message. So it probably won't work for this case. |
I tried this, but on a nontrivial project I end up seeing Cython compilation errors due to missing definitions in the cython headers. So to make compilation proceed to the point where the I was hoping there's a way to do this in pure Cython so I can trigger this error in the Cython compilation step, but it sounds like there isn't. |
|
You could do something like That immediately generates an error (i.e. it essentially just does I couldn't quickly think of a version that generates a much nicer error message. But it at least moves the error message earlier. |
|
Thanks! I also opened cython/cython#7496 to track this feature upstream, IMO something like it would be nice to have in the future. |
4507814 to
60eec13
Compare
rgommers
left a comment
There was a problem hiding this comment.
Thanks Nathan! LGTM modulo some minor issues with the new example.
|
@rgommers thanks for the suggestions! I went ahead and made sure the whole thing is end-to-end runnable, which required adding a |
rgommers
left a comment
There was a problem hiding this comment.
LGTM, but may need to hit the mailing list, so I won't hit the green button just yet.
I sent a message to the mailing list to elicit more feedback. I also said I'd merge the PR next week if no one objects. |
d2b55ce to
efc80a7
Compare
|
No one objected, so I'm planning to merge this as soon as the CI passes. If anyone in the future reads this because of the compiler error introduced in this PR, please open an issue if updating to use Cython 3.0.0 or newer is impossible for some reason. |
According to the cython docs, if there is a
__init__cython-30.pxd, Cython > 3.0 will ignore a__init__.pxd.In an attempt to give downstream users a useful error message, instead of just deleting
__init__.pxdor renaming__init__cython-30.pxd, I left behind__init__.pxdbut made it generate a build error if it is ever used.I also updated the section on using the C API that covers Cython. The old content still talked about distutils, so I took the opportunity to update it to talk about meson.