Skip to content

Option B step 3: drop f2py; one py3 wheel for every Python 3 - #58

Merged
tproffen merged 1 commit into
claude-python-appfrom
claude/inspiring-brahmagupta-ne81m7
Nov 24, 2026
Merged

tproffen merged 1 commit into
claude-python-appfrom
claude/inspiring-brahmagupta-ne81m7

Conversation

@tproffen

Copy link
Copy Markdown
Owner

Targets claude-python-app (not master).

What

Step 3 of option B in migration/WP2_Binding_Decision.md. The package now reaches DISCUS only through libdiffuse_core and ctypes.

Build

  • python/CMakeLists.txt builds only libdiffuse_core.
  • The f2py, NumPy, Cython and PythonExtensions CMake modules are removed.
  • DIFFUSE_PYTHON no longer looks for Python at all; only DIFFUSE_SHARED_LIB still does. So discus_suite in a Python build no longer links libpython.
  • python/suite_python.f90 is renamed to python/diffuse_suite.f90: the same Fortran module suite, without the !f2py lines, compiled into the library only.

Package

  • diffuse/_core.py keeps only CtypesCore. F2pyCore and DIFFUSE_BACKEND are gone, and Session.backend is always "ctypes".
  • pyproject.toml: no NumPy at build time, and wheel.py-api = "py3". The wheel is diffuse-0.1.0.dev0-py3-none-linux_x86_64.whl; it holds the library, the header and the Python files.

CI

  • tools/ci_changes.py: python/*.f90 and python/*.h (the C interface) now count as packaging, so a change there runs everything. Before, diffuse_capi.f90 fell under "python" and would have skipped the Fortran build and legacy tests.
  • The graphics-link check looks at libdiffuse_core.so instead of the f2py module.
  • The DIFFUSE_BACKEND settings are removed.

Docs

  • docs/install.md, python/README.md, tests/README.md, docs/conf.py, the example, the binding decision (step 3 marked done), the WP2 survey and CLAUDE.md.

Tests (local)

  • One wheel, three Pythons: built with pip wheel ., then the same file installed into venvs for Python 3.11, 3.12 and 3.13. Each gives backend == "ctypes" and 131 passed, 34 skipped, 2 xfailed with the installed package.
  • CMake folder (-DDIFFUSE_GRAPHICS=OFF): configures without Python and builds only libdiffuse_core.so, with no libpython. pytest: 131 passed, 34 skipped, 2 xfailed.
  • Graphics build: legacy fast,mc 31 pass, 2 skipped; discus_suite does not link libpython.
  • Sphinx -W: OK.

Note for existing installs

Re-run pip install .. An old suite_python*.so left in a CMake build folder is ignored.


Generated by Claude Code

python/CMakeLists.txt builds only libdiffuse_core. The f2py, NumPy,
Cython and PythonExtensions CMake modules are removed, and DIFFUSE_PYTHON
no longer looks for Python (only DIFFUSE_SHARED_LIB does), so discus_suite
no longer links libpython in a Python build. python/suite_python.f90 is
renamed python/diffuse_suite.f90 (the same module "suite", without the
!f2py lines) and is compiled into the library only.

diffuse/_core.py keeps only CtypesCore; F2pyCore and DIFFUSE_BACKEND are
gone, Session.backend is always "ctypes". pyproject.toml: no NumPy at
build time, wheel.py-api = "py3": one py3-none-<platform> wheel for every
Python 3 (tested: the same wheel passes the tests on 3.11, 3.12, 3.13).

tools/ci_changes.py: python/*.f90 and python/*.h (the C interface) count
as packaging, so changes there run everything. CI checks the library for
graphics links instead of the f2py module. Docs, tests README, binding
decision, survey and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yw8KkfPLawp8Po4f5Bc9v
@tproffen
tproffen merged commit 8f5e462 into claude-python-app Nov 24, 2026
11 checks passed
@tproffen
tproffen deleted the claude/inspiring-brahmagupta-ne81m7 branch November 24, 2026 15:49
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.

2 participants