Skip to content

BUG: Add object cast to avoid warning with limited API#26985

Merged
ngoldbaum merged 1 commit into
numpy:mainfrom
seberg:issue-26756
Jul 19, 2024
Merged

BUG: Add object cast to avoid warning with limited API#26985
ngoldbaum merged 1 commit into
numpy:mainfrom
seberg:issue-26756

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Jul 19, 2024

To be honest, I think we should just delete this from the public API. But I thought I'll start with this, since at least in principle that isn't a bug-release thing to backport.
(And I won't have squirms to delete this even in the future.)

I am not sure setting warnings to errors is wise (at least for Cython and MSVC). OTOH, the Cython module currently truly does nothing except include the headers (it doesn't even use the NumPy .pyd yet).

Closes gh-26756

To be honest, I think we should just delete this from the public API.
But I thought I'll start with this, since at least in
principle that isn't a bug-release thing to backport.

I am not sure setting warnings to errors is wise (at least for Cython and
MSVC).  OTOH, the Cython module currently truly does nothing except
include the headers (it doesn't even use the NumPy `.pyd` yet).
Copy link
Copy Markdown
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the expanded tests. Merging.

'limited_api_latest',
'limited_api_latest.c',
c_args: [
'-DNPY_NO_DEPRECATED_API=NPY_1_21_API_VERSION',
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.

This makes me wonder if a macro that corresponds to "the latest numpy C API version" would be useful. If it doesn't exist already.

@ngoldbaum ngoldbaum merged commit 9235755 into numpy:main Jul 19, 2024
@charris
Copy link
Copy Markdown
Member

charris commented Jul 19, 2024

Doesn't need a backport?

@ngoldbaum
Copy link
Copy Markdown
Member

Forgot to tag it, I don't think this one is problematic to backport.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Jul 19, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile Error when using C-API with Limited API on new Numpy 2.0

3 participants