Building HIT with python packaging #31540
Draft
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.
Precursor to #31361.
Ability to build hit libraries and python bindings via:
Once installed,
hitcommand-line interface is available via a python wrapper around the executableimport hitpython -c "import importlib.resources as rs; print(rs.files('hit').joinpath('moose_hit'))"python -c "import importlib.resources as rs; print(rs.files('hit').joinpath('moose_wasp'))"How it works:
pyproject.tomldefines the package information, which includes a new package namedmoose_hit(this provides the CLI wrapper)setup.pyis where the C++ build happens. It first builds WASP using theupdate_and_rebuild_wasp.shscript. Then it builds the hit executable viamake -C framework/contrib/hit hit. Finally, it builds the python bindings usingsetuptools.Extension. All the source code, libraries, and executable are then copied to the package install.cibuildwheelis also included in thepyproject.tomlto enable cross-platform packaging using CI. This includes testing commands that:hitCLIMiscellaneous:
cythonbuild ofhit.cppNew github action added that builds moose-hit into a wheel for linux x86_64, macos x86_64, and macos arm64 with python versions 3.10-3.13.