Skip to content

Conversation

@zachmprince
Copy link
Contributor

@zachmprince zachmprince commented Sep 16, 2025

Precursor to #31361.

Ability to build hit libraries and python bindings via:

pip install framework/contrib/hit/

Once installed,

  • The hit command-line interface is available via a python wrapper around the executable
  • HIT python bindings are available via import hit
  • HIT libraries are available with the directory outputted from python -c "import importlib.resources as rs; print(rs.files('hit').joinpath('moose_hit'))"
  • WASP libraries are available similarly with python -c "import importlib.resources as rs; print(rs.files('hit').joinpath('moose_wasp'))"

How it works:

  1. pyproject.toml defines the package information, which includes a new package named moose_hit (this provides the CLI wrapper)
  2. setup.py is where the C++ build happens. It first builds WASP using the update_and_rebuild_wasp.sh script. Then it builds the hit executable via make -C framework/contrib/hit hit. Finally, it builds the python bindings using setuptools.Extension. All the source code, libraries, and executable are then copied to the package install.

cibuildwheel is also included in the pyproject.toml to enable cross-platform packaging using CI. This includes testing commands that:

  • Test the hit CLI
  • Run newly added C++ unit tests
  • Run newly added python unit tests

Miscellaneous:

  • Most of the hit unittests in the framework were moved to the new unit tests in the contrib folder.
  • Some bugs were found in the python bindings when writing python unit tests, which required a new cython build of hit.cpp

New 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.

@zachmprince zachmprince self-assigned this Sep 16, 2025
@zachmprince zachmprince force-pushed the moose_hit branch 3 times, most recently from 7645faa to bce2c3c Compare September 16, 2025 21:48
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.

1 participant