Modernize pyalps build (standalone nanobind wheel build) - #107
Draft
skilledwolf wants to merge 8 commits into
Draft
Modernize pyalps build (standalone nanobind wheel build)#107skilledwolf wants to merge 8 commits into
skilledwolf wants to merge 8 commits into
Conversation
Collaborator
Author
|
Apologies, I know this PR will be annoying to review, but I didn't see a way to land this in smaller units. Please let me know what you think, and whether the implicit decisions are reasonable / compatible with your long term vision, I'm happy to make any changes! |
CIBW_ENVIRONMENT does not expand the {project} placeholder (only
before-all/before-build/test/repair commands do), so ALPS_DIR and
CCACHE_DIR were set to the literal string "{project}/...". The wheel
build's find_package(ALPS REQUIRED CONFIG) then could not locate the
ALPSConfig.cmake installed by CIBW_BEFORE_ALL, failing CMake configure.
Use $(pwd), which cibuildwheel evaluates in the build environment
(cwd=/project in the Linux container, repo root on macOS) to the same
directory where _build/cibw-install lives. Validated end-to-end with a
local manylinux_2_28_aarch64 build: wheel builds, repairs, 14 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
musllinux (Alpine/musl) lacks dnf, glibc's SunRPC/XDR, and execinfo. Branch before_all to apk; install libtirpc for ALPS's system-XDR path (ALPS_HAVE_RPC_XDR_H) and disable the execinfo backtrace. Validated end-to-end on musllinux_1_2_aarch64: wheel builds, auditwheel bundles libtirpc, 14/14 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Open
This was referenced Jul 24, 2026
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.
Summary
This PR addresses the Python-package portion of #86. It replaces the
Boost.Python extension modules with nanobind and makes
pyalpsan independentlybuildable scikit-build-core project under
bindings/python/pyalps.The intent is to remove the legacy Python build as a constraint on later ALPS
CMake modernization while preserving the existing Python module surface.
What changes
LICENSE.txtin wheels and sdistsCMake build
collections.abcplotextra and avoid importing it duringpackage initialization
pyproject.tomland remove the obsolete rootrequirements.txtThe declared baseline is Python >= 3.10, NumPy >= 1.26, and SciPy >= 1.13.
Review guide
The commits are intentionally separated by concern and are best reviewed in
order:
feat: migrate pyalps bindings to nanobindThis is the large, predominantly mechanical binding translation. The main
review questions are whether classes, functions, overloads, conversions, and
ownership/reference policies are represented correctly. It deliberately
avoids general C++ API cleanup.
build: retire legacy Python CMake pathsThis removes Python-only options and build machinery that no longer have a
consumer after the standalone package is introduced.
build: relocate pyalps project metadataandbuild: retain macos 26 wheel coverageThese cover project layout, distribution metadata, canonical license
inclusion, and the wheel matrix. The small follow-up commit preserves macOS
26 and avoids physically duplicating the license.
fix: modernize pyalps Python compatibilityThis is a focused Python 3 and NumPy/SciPy compatibility pass, independent of
the C++ binding syntax.
Reviewers do not need to cover every area: C++/nanobind semantics, CMake and
packaging, and Python compatibility can be reviewed independently.
Binding coverage
The previous CMake build and the new standalone build both declare these 17
extension modules:
pyalea_c,pymcdata_c,pytools_c,pyngsparams_c,pyngshdf5_c,pyngsbase_c,pyngsobservable_c,pyngsobservables_c,pyngsresult_c,pyngsresults_c,pyngsapi_c,pyngsrandom01_c,pyngsaccumulator_c,maxent_c,cthyb,ctint, anddwa_c.pyproject.tomlmetadataplotextraValidation
Local validation on macOS arm64 includes:
Homebrew LLVM non-MPI SDK
pyalpsandpyalps.dwawith Matplotlib unavailableCI exercises the CPython 3.10-3.14 wheel matrix and the supported macOS
deployment targets.
Scope and follow-up work
This PR deliberately does not attempt:
Those changes should be easier to review once the legacy Python build no longer
constrains the main build.
Closes the Python packaging portion of #86; it does not close the overall issue.