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

DIPY installation raises Cython warnings #3003

Closed
jhlegarreta opened this issue Dec 10, 2023 · 1 comment · Fixed by #3026
Closed

DIPY installation raises Cython warnings #3003

jhlegarreta opened this issue Dec 10, 2023 · 1 comment · Fixed by #3026

Comments

@jhlegarreta
Copy link
Contributor

Description

The DIPY installation is raising a number of warnings related to Cython code, e.g.

  [72/120] /tmp/pip-build-env-qg5phjrz/overlay/bin/cython -3 --fast-fail --output-file dipy/segment/featurespeed.cpython-311-x86_64-linux-gnu.so.p/featurespeed.c --include-dir /home/runner/work/dipy/dipy/.mesonpy-xdu8i9lv/dipy ../dipy/segment/featurespeed.pyx
  warning: /home/runner/work/dipy/dipy/dipy/segment/featurespeed.pxd:7:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  performance hint: /home/runner/work/dipy/dipy/dipy/segment/featurespeed.pyx:178:33: Exception check will always require the GIL to be acquired. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.

and

  [80/120] /tmp/pip-build-env-qg5phjrz/overlay/bin/cython -3 --fast-fail --output-file dipy/segment/mrf.cpython-311-x86_64-linux-gnu.so.p/mrf.c --include-dir /home/runner/work/dipy/dipy/.mesonpy-xdu8i9lv/dipy ../dipy/segment/mrf.pyx
  performance hint: /home/runner/work/dipy/dipy/dipy/segment/mrf.pyx:239:5: Exception check on '_initialize_param_uniform' will always require the GIL to be acquired.
  Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.

See, for example,
https://github.com/dipy/dipy/actions/runs/7154362044/job/19481785677#step:7:187
https://github.com/dipy/dipy/actions/runs/7154362044/job/19481785819#step:7:187
https://github.com/dipy/dipy/actions/runs/7154362044/job/19481785940#step:7:179

Way to reproduce

Happens on current HEAD and for all OS.

@skoudoro
Copy link
Member

Yes, since Cython 3.0.0, we have a tons of warning. The Cython codebase needs to be clean to follow the standard.

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

Successfully merging a pull request may close this issue.

2 participants