Skip to content

v3: Further fixes for f2py, macos, and spack#523

Open
mathomp4 wants to merge 1 commit intorelease/v3from
feature/v3-f2py-spack-fix-2026Mar04
Open

v3: Further fixes for f2py, macos, and spack#523
mathomp4 wants to merge 1 commit intorelease/v3from
feature/v3-f2py-spack-fix-2026Mar04

Conversation

@mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Mar 4, 2026

Fixed

  • Fixed f2py and f2py3 detection in Spack environments where the f2py
    executable lives in the py-numpy package's bin/ directory rather than
    alongside the Python interpreter. FindF2PY.cmake and FindF2PY3.cmake now
    ask Python directly (import numpy.f2py) to locate the correct f2py
    binary. A two-pass search is used: the preferred locations (Python bin/ and
    numpy-derived bin/) are checked first with NO_DEFAULT_PATH, then a normal
    PATH search is used as a fallback to preserve behaviour on non-Spack
    (e.g. module-based) systems.
  • Fixed find_package(Python3) picking up a different Python 3 interpreter
    (e.g. a newer Homebrew Python) instead of the one already found by
    find_package(Python) in Spack environments. esma_python.cmake now pins
    Python3_EXECUTABLE to Python_EXECUTABLE when find_package(Python) has
    already resolved a Python 3 interpreter, ensuring both find the same Python.

Changed

  • Added Python_FIND_VIRTUALENV FIRST and Python3_FIND_VIRTUALENV FIRST to
    esma_python.cmake so that an active Spack python-venv on PATH is
    preferred over system or framework Pythons.

@mathomp4 mathomp4 self-assigned this Mar 4, 2026
@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Mar 4, 2026
@mathomp4 mathomp4 requested a review from a team as a code owner March 4, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant