Include gnm.shape.data packages in setuptools package list.#21
Merged
Merged
Conversation
bednarikjan
approved these changes
Jul 21, 2026
Collaborator
|
@vraj130 Please update your branch to the ToT. We recently made some minor changes to the CI naming which prevents your PR from integrating with our codebase. Alternatively, you can allow "Allow edits from maintainers" on your branch which would allow us to update the branch on your PR on our side, thanks! |
gnm_base.py, gnm_data_loader.py and gnm_landmarks.py import gnm.shape.data.versions.gnm_specs and gnm_catalog as regular Python modules, but the [tool.setuptools] packages list in pyproject.toml does not declare gnm.shape.data or gnm.shape.data.versions. The package-data globs only cover asset files (npz, images, md, h5), so built distributions omit gnm_specs.py and gnm_catalog.py entirely. As a result, installing gnm-shape from a built wheel (pip install . or a wheel from python -m build) fails at import time: ImportError: cannot import name 'gnm_specs' from 'gnm.shape.data.versions' (unknown location) This is not caught by CI because all workflows install the package in editable mode (pip install -e), which puts the whole source tree on sys.path. Verified by building a wheel before and after this change: before, the wheel contains no .py files under gnm/shape/data/ and importing gnm.shape.gnm_numpy from the installed wheel raises the ImportError above; after, gnm_specs.py and gnm_catalog.py are included (the npz model asset ships in both cases) and GNM.from_local works from the installed wheel.
vraj130
force-pushed
the
fix-shape-packaging
branch
from
July 21, 2026 21:48
e066cda to
9554394
Compare
Contributor
Author
|
@bednarikjan thanks for flagging it, I've rebased it. Also not sure why it doesn't show you but I've always selected the option which allows for you to edit.
One more thing, I've also rebased #28 in case you wanna merge along this one, so It won't need to rebase again, but if the approval process its too long, I will be happy to rebase it again when you have time to attend! |
Collaborator
|
Thanks @vraj130, it worked now and the PR is merged. |
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.

gnm_base.py,gnm_data_loader.py, andgnm_landmarks.pyimportgnm.shape.data.versions.gnm_specsandgnm_catalogas regular Pythonmodules, but the
[tool.setuptools] packageslist inpyproject.tomldoes notdeclare
gnm.shape.dataorgnm.shape.data.versions. Thepackage-dataglobsonly cover asset files (
npz, images,md,h5), so built distributions omitgnm_specs.pyandgnm_catalog.pyentirely.As a result, installing
gnm-shapefrom a built wheel (pip install .without-e, or a wheel frompython -m build) fails at import time:CI does not catch this because all workflows install the package in editable
mode (
pip install -e), which puts the whole source tree onsys.path.Fix: declare the two missing packages in the
packageslist.Verification: built a wheel before and after this change. Before, the wheel
contains no
.pyfiles undergnm/shape/data/and importinggnm.shape.gnm_numpyfrom the installed wheel raises theImportErrorabove.After,
gnm_specs.pyandgnm_catalog.pyare included (the.npzmodel assetships correctly in both cases) and
GNM.from_localworks from the installedwheel, returning the expected
(17821, 3)vertex array.