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

MAINT: add missing noexcept clauses #26129

Merged
merged 2 commits into from Mar 25, 2024
Merged

Conversation

tornaria
Copy link
Contributor

After cython/cython#6087 it's much easier to figure out the missing noexcept clauses. Indeed, cython up to 3.0.9 has a warning that gives lots of false positives, but with the PR above (already merged in cython master and backported to 3.0.x) all the warnings are indeed cases of missing noexcept

To test use this file test_cimport.pyx:

# cython: language_level=3
cimport numpy
cimport numpy.random
cimport numpy.random._bounded_integers
cimport numpy.random._common
cimport numpy.random.bit_generator
cimport numpy.random.c_distributions

and build with cython -X legacy_implicit_noexcept=True test_cimport.pyx (using patched cython, otherwise there will still be false positive warnings).

The first commit applies cleanly to the 1.26.x branch and is meant to backport.

The second commit fixes the remaining instances.

After cython/cython#6087 it's much easier to
figure out the missing noexcept clauses. Indeed, cython up to 3.0.9 has
a warning that gives lots of false positives, but with the PR above
(already merged in cython master and backported to 3.0.x) all the
warnings are indeed cases of missing noexcept

To test use this file `test_cimport.pyx`:
```
# cython: language_level=3
cimport numpy
cimport numpy.random
cimport numpy.random._bounded_integers
cimport numpy.random._common
cimport numpy.random.bit_generator
cimport numpy.random.c_distributions
```
and build with `cython -X legacy_implicit_noexcept=True test_cimport.pyx`

This commit applies cleanly to the 1.26.x branch and is meant to
backport. The next commit fixes the remaining instances.
This commit fixes the remaining instances.

See description in previous commit.
@mattip
Copy link
Member

mattip commented Mar 25, 2024

Seems to make sense. I don't think we are backporting to 1.26 at this point.

Edit: We should backport this to 2.0.0

@mattip mattip added this to the 2.0.0 release milestone Mar 25, 2024
@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Mar 25, 2024
@seberg seberg merged commit 8fb5769 into numpy:main Mar 25, 2024
62 of 63 checks passed
@seberg
Copy link
Member

seberg commented Mar 25, 2024

Thanks @tornaria.

This may be good to backport to 1.26.x in case we do another release as I think it could otherwise limit a projects move to build with NumPy 1.x and Cython 3. As @tornaria noted, commit 9b27220 should be back-portable.

@charris
Copy link
Member

charris commented Mar 25, 2024

I am planning on one more 1.26 release around the time of 2.0.0

@charris charris modified the milestones: 2.0.0 release, 1.26.5 release Mar 25, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 25, 2024
@tornaria tornaria deleted the add-missing-noexcept branch March 25, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants