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

Failure to build python module with Cython 3.0.0 #531

Open
marcpaterno opened this issue Jul 17, 2023 · 4 comments
Open

Failure to build python module with Cython 3.0.0 #531

marcpaterno opened this issue Jul 17, 2023 · 4 comments

Comments

@marcpaterno
Copy link

Cython 3.0.0 was released today. The build of the python module fails with this version of cython because “cpdef” is no longer allowed in the creation of local variables; instead, “cdef” should be used.

Changing all instances of “cpdef” to “cdef” seems to allow the build to success, and the python module resulting can be imported.

@tilmantroester
Copy link

I just ran into this as well. For reference, this has been the case since 3.0.0a8: http://docs.cython.org/en/latest/src/changes.html#alpha-8-2021-07-02.

@damonge
Copy link

damonge commented Jul 19, 2023

Just to confirm that I've also come across this, and it seems important enough to be fixed!

@lgarrison
Copy link

I also ran into this. One trick to work around this in GH Actions is to install the build requirements (including Cython<3) directly into the environment, and then disable pip build isolation:

pip install 'setuptools' 'wheel' 'numpy>=1.19.0' 'Cython>=0.29.21,<3'  # for classy
pip install --no-build-isolation classy

https://github.com/abacusorg/abacusutils/blob/052aa6275276e9b634550992b53d7b62b7e9a929/.github/workflows/tests.yml#L26-L27

@damonge
Copy link

damonge commented Jul 21, 2023

After some tinkering, that did the trick. Thanks @lgarrison !
Hope this can be patched soon though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants