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

Update numpy.i for SWIG 4.3 compatibility #55

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

musicinmybrain
Copy link
Contributor

Update numpy.i to the latest version, from
https://github.com/numpy/numpy/blob/v2.1.2/tools/swig/numpy.i, plus apply the changes from numpy/numpy#27579.

An incompatibility with the upcoming SWIG 4.3 test was reported in Fedora Linux. I reported the issue to numpy in numpy/numpy#27578 and proposed a fix in numpy/numpy#27579. This PR circles back to where things started, copying in the latest numpy.i from numpy upstream, plus the changes from numpy/numpy#27579.

@traversaro
Copy link
Collaborator

fyi @diegoferigo

Copy link
Owner

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

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

Thanks a lot @musicinmybrain for your work and for propagating it all the way up to this project, I'm no longer following that much the SWIG-related development. It makes sense to update the vendored numpy.i file of the example. I'm wondering if there's a more robust approach, like downloading the revision of numpy.i matching the numpy version found in the system from git repository. I accept PRs if anyone wants to have a look at it.

I need to fix the PyPI pipeline before merging this PR.

@traversaro
Copy link
Collaborator

I'm wondering if there's a more robust approach, like downloading the revision of numpy.i matching the numpy version found in the system from git repository. I accept PRs if anyone wants to have a look at it.

That would not work for the specific case of SWIG 4.3.0 compatibility. For example, the latest numpy released does not contain this fix, so if you for example installed the latest numpy and swig from conda-forge, you will end up with swig 4.3.0 and numpy 2.1.2, but https://github.com/numpy/numpy/blob/v2.1.2/tools/swig/numpy.i does not contain the changes, that indeed are in numpy/numpy#27579 .

@diegoferigo
Copy link
Owner

I'm wondering if there's a more robust approach, like downloading the revision of numpy.i matching the numpy version found in the system from git repository. I accept PRs if anyone wants to have a look at it.

That would not work for the specific case of SWIG 4.3.0 compatibility. For example, the latest numpy released does not contain this fix, so if you for example installed the latest numpy and swig from conda-forge, you will end up with swig 4.3.0 and numpy 2.1.2, but https://github.com/numpy/numpy/blob/v2.1.2/tools/swig/numpy.i does not contain the changes, that indeed are in numpy/numpy#27579 .

Mmh it makes sense. I guess that there's no real workaround. Vendoring numpy.i and maintaining it aligned is and will remain a responsibility of downstream projects.

@diegoferigo diegoferigo merged commit 4bd5dab into diegoferigo:master Oct 28, 2024
19 checks passed
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

Successfully merging this pull request may close these issues.

3 participants