Skip to content

MAINT,BUG: Never import distutils above 3.12 [f2py] #25123

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

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

HaoZeke
Copy link
Member

@HaoZeke HaoZeke commented Nov 12, 2023

Closes gh-24838. There were two locations in f2py where the options passed in would trigger an import of distutils. This simply guards them via an if.

@HaoZeke HaoZeke requested a review from mattip November 12, 2023 16:44
@HaoZeke
Copy link
Member Author

HaoZeke commented Nov 12, 2023

I think this could do with a backport @charris :)

@mattip
Copy link
Member

mattip commented Nov 13, 2023

Is there a test that failed before/passes after this PR? Maybe one that calls subprocess.run with f2py --fcompiler=gfortran -c -m ?

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Nov 14, 2023
@HaoZeke
Copy link
Member Author

HaoZeke commented Nov 18, 2023

Is there a test that failed before/passes after this PR? Maybe one that calls subprocess.run with f2py --fcompiler=gfortran -c -m ?

Yup, done :)

cc @mattip

@HaoZeke HaoZeke force-pushed the noDistutils312 branch 6 times, most recently from 764d6e6 to 58566b9 Compare November 19, 2023 04:36
@mattip
Copy link
Member

mattip commented Nov 19, 2023

After #25181, needs a rebase

@HaoZeke
Copy link
Member Author

HaoZeke commented Nov 19, 2023

After #25181, needs a rebase

Yup, done, though maybe merging #25111 first would be better? Then the tests would run more comprehensively.

@rgommers
Copy link
Member

This has a conflict, can you rebase @HaoZeke?

Yup, done, though maybe merging #25111 first would be better? Then the tests would run more comprehensively.

This is an actual bug fix and quite small (most of the diff is a code move, the actual fixes are easy to identify). I'm seeing f2py problems in CI, so I'd prefer to get this in.

@rgommers rgommers added this to the 2.0.0 release milestone Nov 22, 2023
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This LGTM, in it goes. Thanks @HaoZeke & reviewers.

@rgommers rgommers merged commit 3d80ade into numpy:main Nov 22, 2023
@HaoZeke HaoZeke deleted the noDistutils312 branch November 22, 2023 21:31
charris pushed a commit to charris/numpy that referenced this pull request Dec 19, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 19, 2023
@HaoZeke HaoZeke restored the noDistutils312 branch June 15, 2024 23:40
@TimotheusBachinger TimotheusBachinger mentioned this pull request Nov 25, 2024
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: f2py still attempts to import numpy.distutils on Python 3.12 when --fcompiler option is specified.
4 participants