Skip to content

feat(pi-fortran): use f2py-cmake instead of hand-rolled f2py wiring#73

Merged
henryiii merged 1 commit into
mainfrom
pi-fortran-f2py-cmake
Jun 23, 2026
Merged

feat(pi-fortran): use f2py-cmake instead of hand-rolled f2py wiring#73
henryiii merged 1 commit into
mainfrom
pi-fortran-f2py-cmake

Conversation

@henryiii

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

The pi-fortran example now relies on f2py-cmake 0.2 rather than doing the f2py glue itself.

Changes

  • CMakeLists.txt: replaced the manual numpy.f2py.get_include() probe, the add_custom_command that generated pimodule.c, and the explicit python_add_library listing fortranobject.c with include(UseF2Py) + a single f2py_add_module(pi/pi.pyf pi/_pi.f). The default --lower and F77 auto-detection match the previous behavior, and the checked-in .pyf signature (the underscore-problem fix) is passed straight through. The Windows MinGW -static link block is preserved against the pi target.
  • pyproject.toml: added f2py-cmake>=0.2 to [build-system].requires.
  • README.md: noted that f2py-cmake handles the glue, and fixed the stale _skbuildbuild cleanup tip (this is a scikit-build-core project).

Testing

  • uvx nox -s "test(pi-fortran)" → 1 passed
  • prek -a clean

No CI/noxfile changes needed: f2py-cmake is pulled from PyPI at build time like any other build requirement.

Replace the manual numpy.f2py include probe, add_custom_command wrapper
generation, and explicit fortranobject.c plumbing with f2py-cmake's
UseF2Py module and a single f2py_add_module call. Default --lower and
F77 detection preserve the previous behavior; the checked-in .pyf
signature (the underscore-problem fix) is passed straight through.

Assisted-by: ClaudeCode:claude-opus-4.8
@henryiii henryiii merged commit 4e47570 into main Jun 23, 2026
11 checks passed
@henryiii henryiii deleted the pi-fortran-f2py-cmake branch June 23, 2026 14:13
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.

1 participant