Skip to content

Add generated SDK import smoke test#61

Draft
ivanleomk wants to merge 1 commit into
mainfrom
import-smoke-test
Draft

Add generated SDK import smoke test#61
ivanleomk wants to merge 1 commit into
mainfrom
import-smoke-test

Conversation

@ivanleomk

@ivanleomk ivanleomk commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Adds a lightweight unittest smoke test for generated SDK import integrity.

The test verifies that:

  • import kagglesdk succeeds
  • every discovered kagglesdk.* module imports cleanly
  • KaggleClient() instantiates
  • the expected top-level client groups are present
  • the generated client exposes 21 nested *_client subclients

Why

The 0.1.31/0.1.32 import regression was caused by generated files referencing modules that were not included in the synced/published package. A build-only release step can still succeed in that case because wheel construction does not import the full transitive module graph.

This gives the release flow a cheap import-closure check that catches missing generated modules before publishing.

Evidence

Current main plus this test fails after installing the project into a fresh environment:

ModuleNotFoundError: No module named 'kagglesdk.competitions.legacy'

Ran 2 tests in 1.218s
FAILED (errors=2)

The same test overlaid onto origin/fix-imports-0.1.33 passes:

Ran 2 tests in 1.852s
OK

Reproduction commands

Run the test on this branch, which is based on current main and demonstrates the missing-import failure:

git fetch origin
git checkout import-smoke-test
uv run --with-editable . python -m unittest tests.test_import_smoke

Run the exact same test against the 0.1.33 fix branch by saving this PR's test file before switching branches:

cp tests/test_import_smoke.py /tmp/test_import_smoke.py
git checkout origin/fix-imports-0.1.33
mkdir -p tests
cp /tmp/test_import_smoke.py tests/test_import_smoke.py
uv run --with-editable . python -m unittest tests.test_import_smoke
rm /tmp/test_import_smoke.py

@stevemessick

Copy link
Copy Markdown
Contributor

This looks like a good idea. We will need to add it to the code generator and link in some GitHub checks.

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.

2 participants