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

BLD: Future incompatibility with Cython 3.1 #4044

Closed
neutrinoceros opened this issue Jul 31, 2022 · 4 comments · Fixed by #4948
Closed

BLD: Future incompatibility with Cython 3.1 #4044

neutrinoceros opened this issue Jul 31, 2022 · 4 comments · Fixed by #4948
Labels
build related to the build process dependencies Pull requests that update a dependency file refactor improve readability, maintainability, modularity
Milestone

Comments

@neutrinoceros
Copy link
Member

Bug report

Bug summary

Building yt's Cython extensions with Cython 3.0.0a10 revealed that some modules are currently relying on deprecated API, as for instance

warning: yt/utilities/lib/image_samplers.pxd:18:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310

Namely, we currently use IF and DEF here and there, which are going away at some point in a future version of Cython
(see cython/cython#4310)
I estimate that we have 16 occurrences of DEF and 2 IF, so I'm hopeful that refactoring all of them is feasible

@neutrinoceros neutrinoceros added the refactor improve readability, maintainability, modularity label Jul 31, 2022
@neutrinoceros
Copy link
Member Author

I was able to shrink the number of such compilation warnings in #4043 from >100 to about 10.

@neutrinoceros
Copy link
Member Author

neutrinoceros commented Aug 1, 2022

There's only one usage of IF/ELSE that I don't know how to refactor, namely

IF UNAME_SYSNAME == "Windows":
ctypedef uint32_t ewah_word_type
ELSE:
ctypedef np.uint32_t ewah_word_type

It corresponds exactly to the following commit bd1fb35

I asked the Cython help mailing list about it and so far this is the answer I got

I'd probably just replace this with

ctypedef uint32_t ewah_word_type

I can't really see a difference between these two cases here.

So... that would be an exact revert for bd1fb35

@jzuhone, do you remember this and can you explain what problem this solved ? Do you know if it's still relevant ?

@matthewturk
Copy link
Member

I remember this being extremely annoying to fix, but I can't remember why.

@neutrinoceros neutrinoceros linked a pull request Aug 2, 2022 that will close this issue
@neutrinoceros neutrinoceros changed the title Future incompatibility with Cython BLD: Future incompatibility with Cython 3.1 Jul 27, 2023
@neutrinoceros neutrinoceros added infrastructure Related to CI, versioning, websites, organizational issues, etc dependencies Pull requests that update a dependency file labels Jul 27, 2023
@neutrinoceros
Copy link
Member Author

This is still relevant after #4575 is merged, however this is an incompatibility with Cython 3.1 at the earliest.

@neutrinoceros neutrinoceros added build related to the build process and removed infrastructure Related to CI, versioning, websites, organizational issues, etc labels Jul 31, 2023
@neutrinoceros neutrinoceros added this to the 4.4.0 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build related to the build process dependencies Pull requests that update a dependency file refactor improve readability, maintainability, modularity
Projects
None yet
2 participants