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

BUG: Handle .pyf.src and fix SciPy [urgent] #25287

Merged
merged 8 commits into from Dec 1, 2023
Merged

Conversation

HaoZeke
Copy link
Member

@HaoZeke HaoZeke commented Nov 30, 2023

Closes gh-25286. We don't have tests for .pyf.src files, which can be added in a follow up. It would also be nice for f2py to provide the from_template functionality instead of forcing generate_f2pymod.py in scipy to vendor it from distutils.

@tylerjereddy if this works for you as well I'd suggest it might be worthwhile to merge this now.

@charris this will need to be backported.

A lot of these are very annoyingly tiny bugs, but each one slowly inches f2py towards a better testsuite (among other things).

This PR:

  • Don't lower .pyf files
  • Stop making useless untitled modules
  • Fix some of the #defines

Also:

  • Vendors the .src file handling
  • Re-establishes old distutils behavior w.r.t. compiled extension modules
    • Basically overwrites them

Tests:

@HaoZeke
Copy link
Member Author

HaoZeke commented Nov 30, 2023

Test failures are because of compute limits.

EDIT: manylinux 32-bit failure is real.

@HaoZeke HaoZeke marked this pull request as draft November 30, 2023 23:40
@HaoZeke
Copy link
Member Author

HaoZeke commented Nov 30, 2023

Will finalize this tomorrow.

@HaoZeke HaoZeke marked this pull request as ready for review December 1, 2023 23:01
@HaoZeke HaoZeke changed the title BUG: Handle .pyf.src again BUG: Handle .pyf.src and fix SciPy [urgent] Dec 1, 2023
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

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

@tylerjereddy if this works for you as well I'd suggest it might be worthwhile to merge this now.

Ok, I skimmed through the diff and confirmed that SciPy main testsuite is back to "normal" (other unrelated issues) with this NumPy branch on M2 Mac, so seems fixed to me.

I'm obviously not an f2py expert, but there's some suggestion we should try to get this in and it does unbreak SciPy with some more regression tests.

@tylerjereddy
Copy link
Contributor

I'll merge it, normally I squash backport candidates for SciPy to make backporting easier; however, maybe Chuck will forgive me for not squashing in this case given that some commits are distinct vendoring commits and so on, and it can also be helpful if we need to bisect again (hopefully not, but...).

@tylerjereddy tylerjereddy merged commit 44570a8 into numpy:main Dec 1, 2023
60 of 62 checks passed
@HaoZeke HaoZeke deleted the gh25286 branch December 1, 2023 23:30
@charris
Copy link
Member

charris commented Dec 2, 2023

however, maybe Chuck will forgive me for not squashing

I plan to do worse, once f2py settles a bit I'm going to straight copy it down into 1.26.x. I'd usually let things ride, but 2.0 isn't going to come out this month. I some point I distutils might break in 1.26, but meson builds seem to be stabilizing downstream.

@rgommers
Copy link
Member

rgommers commented Dec 2, 2023

Thanks for the quick fix!

It would also be nice for f2py to provide the from_template functionality instead of forcing generate_f2pymod.py in scipy to vendor it from distutils.

Please don't try this. I on purpose did not do that, not only because the .src format is unrelated to f2py but also because it's terrible and no one should start using it in 2023. The SciPy generate_f2pymod script is fine until we manage to get rid of this templating format completely.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Dec 18, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 23, 2023
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.

BUG: NumPy main breaking SciPy main build on Mac ARM64 (bisected on f2py change)
4 participants