Skip to content

fix(sdk): include package files in the built wheel (#32) - #33

Merged
prashar32 merged 2 commits into
mainfrom
fix/sdk-wheel-packaging
May 31, 2026
Merged

fix(sdk): include package files in the built wheel (#32)#33
prashar32 merged 2 commits into
mainfrom
fix/sdk-wheel-packaging

Conversation

@prashar32

Copy link
Copy Markdown
Owner

Closes #32.

Problem

pip install riskkernel (and installing the SDK by path, as examples/codebase-qa does) installed a package with no modulesimport riskkernel raised ModuleNotFoundError. The wheel hatchling built contained only *.dist-info.

Cause

The SDK project lives in a repo subdirectory (sdks/python). Hatchling's default VCS-aware file selector lists tracked files with paths relative to the repo root (sdks/python/riskkernel/...), which don't match the project-root-relative packages = ["riskkernel"] include — so the build matched no files. make sdk-test didn't catch it because it runs against the source tree on PYTHONPATH, not an installed wheel.

Fix

One line in sdks/python/pyproject.toml:

[tool.hatch.build]
ignore-vcs = true

Hatchling now selects files from the filesystem. Verified: the wheel ships all 9 modules and imports cleanly (including the lazy adapters submodule).

$ pip wheel ./sdks/python -w /tmp/w
$ python -c "import zipfile,glob; print(len([n for n in zipfile.ZipFile(glob.glob('/tmp/w/riskkernel-*.whl')[0]).namelist() if n.endswith('.py')]))"
9
$ pip install /tmp/w/riskkernel-*.whl && python -c "import riskkernel; print('ok')"
ok

This is release-worthy on its own — suggest a fast v0.1.1.

Follow-up (separate)

Add a CI step that builds the wheel and imports riskkernel from the installed wheel (not source), so packaging regressions are caught — noted in #32.

prashar32 added 2 commits May 31, 2026 18:46
The Python SDK project lives in a repo subdirectory (sdks/python). Hatchling's
default VCS-aware file selector lists tracked files relative to the repo root,
which don't match the project-root-relative `packages = ["riskkernel"]` include,
so the built wheel contained only dist-info — `pip install riskkernel` installed
no modules and `import riskkernel` failed.

Set `ignore-vcs = true` so hatchling selects files from the filesystem. The wheel
now ships all 9 modules and imports cleanly. `make sdk-test` missed this because
it runs against the source tree on PYTHONPATH, not an installed wheel.

Fixes #32
@prashar32
prashar32 merged commit 0557dce into main May 31, 2026
6 checks passed
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.

Python SDK builds an empty wheel — package files excluded (pip install installs nothing)

1 participant