8000 ENH: ``meson`` backend for ``f2py`` by HaoZeke · Pull Request #24532 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: meson backend for f2py #24532

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 37 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fe49281
FIX: Import f2py2e rather than f2py for run_main
NamamiShanker Jul 11, 2022
6b1475e
FIX: Import f2py2e instead of f2py
NamamiShanker Jul 12, 2022
91f3825
ENH: Add F2PY back-end work from gh-22225
HaoZeke Aug 24, 2023
a0b01c3
ENH: Add meson skeleton from gh-2225
HaoZeke Aug 24, 2023
384aa96
MAINT: Trim backend.py down to f2py2e flags
HaoZeke Aug 25, 2023
26b224f
ENH: Add a factory function for backends
HaoZeke Aug 25, 2023
3a5c43d
ENH: Add a distutils backend
HaoZeke Aug 25, 2023
d03d28d
ENH: Handle --backends in f2py
HaoZeke Aug 25, 2023
1d279bc
DOC: Add some minor comments in f2py2e
HaoZeke Aug 25, 2023
0f0e3ac
MAINT: Refactor and rework meson.build.src
HaoZeke Aug 25, 2023
323fa5b
MAINT: Add objects
HaoZeke Aug 25, 2023
8d4368b
MAINT: Cleanup distutils backend
HaoZeke Aug 25, 2023
7bd8c34
MAINT: Refactor to add everything back to backend
HaoZeke Aug 25, 2023
d7a1ea9
MAINT: Fix overly long line
HaoZeke Aug 25, 2023
a95e71a
BUG: Construct wrappers for meson backend
HaoZeke Aug 25, 2023
0621032
MAINT: Rework, simplify template massively
HaoZeke Aug 25, 2023
677e42a
ENH: Truncate meson.build to skeleton only
HaoZeke Aug 25, 2023
2517afe
MAINT: Minor backend housekeeping, name changes
HaoZeke Aug 25, 2023
1dc2733
MAINT: Less absolute paths, update setup.py [f2py]
HaoZeke Aug 25, 2023
42a15ac
MAINT: Move f2py module name functionality
HaoZeke Aug 25, 2023
6776dba
ENH: Handle .pyf files
HaoZeke Aug 25, 2023
0357ab8
TST: Fix typo in isoFortranEnvMap.f90
HaoZeke Aug 25, 2023
5faec2f
MAINT: Typo in f2py2e support for pyf files
HaoZeke Aug 25, 2023
5b79487
DOC: Add release note for --backend
HaoZeke Aug 25, 2023
faadb6d
MAINT: Conditional switch for Python 3.12 [f2py]
HaoZeke Aug 25, 2023
82a4f8f
MAINT: No absolute paths in backend [f2py-meson]
HaoZeke Aug 25, 2023
6585458
MAINT: Prettier generated meson.build files [f2py]
HaoZeke Aug 25, 2023
f85581e
ENH: Add meson's dependency(blah) to f2py
HaoZeke Aug 25, 2023
16f22ee
DOC: Document the new flag
HaoZeke Aug 25, 2023
c0c6bf1
MAINT: Simplify and rename backend template [f2py]
HaoZeke Aug 26, 2023
fa06f8d
ENH: Support build_type via --debug [f2py-meson]
HaoZeke Aug 26, 2023
8841647
MAINT,DOC: Reduce warn,rework doc [f2py-meson]
HaoZeke Aug 26, 2023
8f214a0
ENH: Rework deps: to --dep calls [f2py-meson]
HaoZeke Aug 26, 2023
bc37684
MAINT,DOC: Add --backend to argparse, add docs
HaoZeke Aug 26, 2023
4e3336b
MAINT: Rename meson template [f2py-meson]
HaoZeke Aug 26, 2023
518074e
MAINT: Add meson.build for f2py
HaoZeke Aug 29, 2023
cc92d2c
BLD: remove duplicate f2py handling in meson.build files
rgommers Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doc/release/upcoming_changes/24532.new_feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
``meson`` backend for ``f2py``
------------------------------
``f2py`` in compile mode (i.e. ``f2py -c``) now accepts the ``--backend meson`` option. This is the default option
for Python ``3.12`` on-wards. Older versions will still default to ``--backend
distutils``.

To support this in realistic use-cases, in compile mode ``f2py`` takes a
``--dep`` flag one or many times which maps to ``dependency()`` calls in the
``meson`` backend, and does nothing in the ``distutils`` backend.


There are no changes for users of ``f2py`` only as a code generator, i.e. without ``-c``.
8 changes: 4 additions & 4 deletions numpy/distutils/command/build_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ def f2py_sources(self, sources, extension):
if (self.force or newer_group(depends, target_file, 'newer')) \
and not skip_f2py:
log.info("f2py: %s" % (source))
import numpy.f2py
numpy.f2py.run_main(f2py_options
from numpy.f2py import f2py2e
f2py2e.run_main(f2py_options
+ ['--build-dir', target_dir, source])
else:
log.debug(" skipping '%s' f2py interface (up-to-date)" % (source))
Expand All @@ -558,8 +558,8 @@ def f2py_sources(self, sources, extension):
and not skip_f2py:
log.info("f2py:> %s" % (target_file))
self.mkpath(target_dir)
import numpy.f2py
numpy.f2py.run_main(f2py_options + ['--lower',
from numpy.f2py import f2py2e
f2py2e.run_main(f2py_options + ['--lower',
'--build-dir', target_dir]+\
['-m', ext_name]+f_sources)
else:
Expand Down
9 changes: 9 additions & 0 deletions numpy/f2py/_backends/__init__.py