Repository navigation
Include subpackages and runtime data in built wheels - #188
Asterisk-Hunter wants to merge 3 commits into
Conversation
92fbf76 to
540dfcf
Compare
|
Hi @RichRick1 and @giovanni-br, I opened this after reproducing the missing package files from a clean wheel install. The isolated wheel smoke test and package tests are passing. Could you let me know whether this fix is in the right direction or needs any changes? I am keen to keep contributing to ModelHamiltonian and would appreciate a pointer to the next useful issue after this one. |
There was a problem hiding this comment.
🟢 Approval recommended
The packaging changes address the reported failure, the smoke check covers imports and required resources, and no blocking issues remain.
No open issues 🎉
What changed in this PR
Fixes wheel packaging so installed moha includes its subpackages and runtime resources, resolving imports that fail outside the checkout.
Changes:
- Enables subpackage discovery and includes JSON/TOML runtime data.
- Adds a CI smoke check that installs the built wheel into an isolated target, imports it outside the checkout, and checks all six resource files.
- Removes trailing whitespace from a docstring without changing runtime logic.
| File | Description |
|---|---|
pyproject.toml |
Configures subpackage discovery and runtime resource inclusion. |
moha/hamiltonians.py |
Removes trailing whitespace from the HamHeisenberg docstring. |
.github/workflows/main.yml |
Adds the installed-wheel import and resource smoke check. |
Review effort: Balanced
|
I traced the failed check to actions/setup-python being unable to find Python 3.10.12 on the Ubuntu 26.04 runner. I pinned the workflow to Ubuntu 24.04 in commit b6ce270. The new PR run is marked action_required and has no jobs, so it appears to need maintainer approval before it can run. Could someone approve the run? The package tests pass locally (9 passed). |
A clean wheel currently includes only the top-level
mohamodules, so importing the installed package outside the checkout raisesModuleNotFoundError: No module named 'moha.rauk'.Discover the
mohasubpackages and include their JSON/TOML runtime resources. Add a CI smoke check that installs the built wheel into an isolated target, imports it outside the checkout, and verifies the six runtime data files.Validation:
e27c5b9produced a wheel withoutmoha.raukand failed the isolated import; the fixed wheel imports successfully and contains all six runtime resources.python -m pytest -q moha/test: 9 passed, with SparseEfficiencyWarnings.git diff --checkandpycodestyle moha/: passed.pydocstyle moha/: existing D205/D207/D400 errors in theHamHeisenbergdocstring. The pre-commit bot removed its trailing whitespace; this PR changes no Python runtime logic.