Skip to content

MAINT: skip failing cython limited API tests on Cython 3.3.0 - #32407

Merged
charris merged 1 commit into
numpy:mainfrom
ngoldbaum:fix-cython-tests
Aug 24, 2026
Merged

charris merged 1 commit into
numpy:mainfrom
ngoldbaum:fix-cython-tests

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Aug 24, 2026

Copy link
Copy Markdown
Member

PR summary

Alternative to #32393.

See upstream report at cython/cython#7914 as well.

Implements @rgommers' suggested alternative to pinning: #32393 (comment)

I'm checking for exactly Cython 3.3.0 under the theory that 3.3.1 will have a fix.

AI Disclosure

No AI used.

@ikrommyd ikrommyd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Skipping instead of pinning is the better of the two fixes IMO. I think that betting that 3.3.1 will have the fix is fine. Skipping for >= 3.3.0 until one manually changes it again is worse I think cause we might forget.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Aug 24, 2026
@charris
charris merged commit 765c585 into numpy:main Aug 24, 2026
90 checks passed
@charris

charris commented Aug 24, 2026

Copy link
Copy Markdown
Member

Thanks Nathan.

@rgommers

Copy link
Copy Markdown
Member

@charris please don't backport this just yet, I think there is a decent chance that the test is wrong. See #32393 (comment).

@charris

charris commented Aug 24, 2026

Copy link
Copy Markdown
Member

@rgommers OK

@rgommers

Copy link
Copy Markdown
Member

This test could still really benefit from a clear explanation of what it's actually doing. The extension module is built only once, so what is and isn't covered by calling _check_api_module multiple times with different versions of python and numpy for the name of mod?

charris added a commit that referenced this pull request Aug 25, 2026
MAINT: skip failing cython limited API tests on Cython 3.3.0 (#32407)
@mattip

mattip commented Aug 27, 2026

Copy link
Copy Markdown
Member

This came in from #31822 by @kumaraditya303 and reviewed by @ngoldbaum. The PR does not have an issue attached, the only hint to the reason for it being added was

I've expanded tests to cover the datetime APIs which was broken recently to avoid such future breakages.

I did not see any review around the module being built only once. I think the intention was to build it for each iteration of the test. But I may be wrong.

@kumaraditya303

Copy link
Copy Markdown
Contributor

@mattip Building once is intentional, the single meson build compiles a separate module for each (abi3 python, numpy target) combination, see the loops in examples/limited_api/meson.build. Each parametrized test imports its own module by name (e.g. limited_api_cython_3_11_npy2_2) so every iteration tests a differently compiled binary. Rebuilding per test would just produce the same binaries serially. I think this test caught a real Cython bug where any process importing two abi3 cython modules targeting <3.11 and 3.11 was affected.

@rgommers

Copy link
Copy Markdown
Member

I'm convinced now, thanks for the explanation added in gh-32444 Kumar.

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.

6 participants