Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BLD: only install the f2py command, not f2py3 or f2py3.X #24235

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
Jul 22, 2023

Conversation

rgommers
Copy link
Member

Also fix a build warning for a missing check keyword in a run_command call, and some other build file cleanups.

This takes care of an open issue from the Meson build migration (xref gh-23981).

Use of f2py3 is not present at all in the docs, and Python 2.7 is well and truly gone now. Using f2py3.11 or similar is even less common, difficult to support (it prevents keeping the metadata in pyproject.toml completely static), and it's perfectly fine in those cases anyway to use python3.11 -m numpy.f2py.

Going via a specific Python interpreter executable has become more commonplace, e.g. python -m pip to ensure picking up the correct version of pip.

rgommers added 3 commits July 22, 2023 18:23
Also extend a comment on linking libm, and clean up a few lines of
unused code.
This takes care of an open issue from the Meson build migration
(xref numpygh-23981).

Use of `f2py3` is not present at all in the docs, and Python 2.7
is well and truly gone now. Using `f2py3.11` or similar is even less
common, difficult to support (it prevents keeping the metadata in
`pyproject.toml` completely static), and it's perfectly fine in
those cases anyway to use `python3.11 -m numpy.f2py`.

Going via a specific Python interpreter executable has become more
commonplace, e.g. `python -m pip` to ensure picking up the correct
version of `pip`.
@rgommers rgommers added 36 - Build Build related PR Meson Items related to the introduction of Meson as the new build system for NumPy labels Jul 22, 2023
@rgommers rgommers added this to the 2.0.0 release milestone Jul 22, 2023
@charris
Copy link
Member

charris commented Jul 22, 2023

and it's perfectly fine in those cases anyway to use python3.11 -m numpy.f2py.

I think it should be documented as the preferred way. Like pip, there is always the problem of which numpy is being used, which can a problem when there are multiple installations.

@charris charris merged commit c41f919 into numpy:main Jul 22, 2023
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jul 22, 2023
@rgommers rgommers deleted the meson-fixes branch July 22, 2023 19:21
@charris charris modified the milestones: 2.0.0 release, 1.26.0 release Jul 23, 2023
@eli-schwartz
Copy link

eli-schwartz commented Jul 24, 2023

Does f2py actually produce different results based on the python version it is running under, even for python2 vs python3? Or does it only change depending on the numpy version (which makes sense, different versions of f2py will naturally tend to produce different results)?

If anything, maybe there should be a f2py2.0 and f2py1.26. 😛

...

The original rationale in f22a33b appears to have been "because linux distros" which seems misguided as Linux distros should just be shipping a single entrypoint anyway for command-line programs. When they break this theme it causes issues such as "there is no cython command on Debian because the python2-cython package was deleted"...

@rgommers
Copy link
Member Author

Does f2py actually produce different results based on the python version it is running under

Not for transpiling to C/Fortran wrappers only, but f2py -c produces a Python extension module in one go, so yes that'll be different.

The original rationale in f22a33b appears to have been "because linux distros" which seems misguided as Linux distros should just be shipping a single entrypoint anyway for command-line programs.

Agreed. I think a single f2py command is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
36 - Build Build related PR Meson Items related to the introduction of Meson as the new build system for NumPy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants