Repository navigation
Option B step 3: drop f2py; one py3 wheel for every Python 3 - #58
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Targets
claude-python-app(notmaster).What
Step 3 of option B in
migration/WP2_Binding_Decision.md. The package now reaches DISCUS only throughlibdiffuse_coreand ctypes.Build
python/CMakeLists.txtbuilds onlylibdiffuse_core.DIFFUSE_PYTHONno longer looks for Python at all; onlyDIFFUSE_SHARED_LIBstill does. Sodiscus_suitein a Python build no longer links libpython.python/suite_python.f90is renamed topython/diffuse_suite.f90: the same Fortran modulesuite, without the!f2pylines, compiled into the library only.Package
diffuse/_core.pykeeps onlyCtypesCore.F2pyCoreandDIFFUSE_BACKENDare gone, andSession.backendis always"ctypes".pyproject.toml: no NumPy at build time, andwheel.py-api = "py3". The wheel isdiffuse-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/*.f90andpython/*.h(the C interface) now count as packaging, so a change there runs everything. Before,diffuse_capi.f90fell under "python" and would have skipped the Fortran build and legacy tests.libdiffuse_core.soinstead of the f2py module.DIFFUSE_BACKENDsettings 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 andCLAUDE.md.Tests (local)
pip wheel ., then the same file installed into venvs for Python 3.11, 3.12 and 3.13. Each givesbackend == "ctypes"and 131 passed, 34 skipped, 2 xfailed with the installed package.-DDIFFUSE_GRAPHICS=OFF): configures without Python and builds onlylibdiffuse_core.so, with no libpython. pytest: 131 passed, 34 skipped, 2 xfailed.discus_suitedoes not link libpython.-W: OK.Note for existing installs
Re-run
pip install .. An oldsuite_python*.soleft in a CMake build folder is ignored.Generated by Claude Code