Skip to content

Fix Rust extension types and simplify type checks - #209

Open
timkpaine wants to merge 3 commits into
mainfrom
tkp/rust-extension-type-stubs
Open

timkpaine wants to merge 3 commits into
mainfrom
tkp/rust-extension-type-stubs

Conversation

@timkpaine

@timkpaine timkpaine commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Enabling check-types made Copier update python-project-templates/python-template-rustjswasm#149 fail: ty cannot resolve the compiled Rust module imported when add_pyodide=true. Add an Example constructor stub to both Rust templates.

Base CI currently renders these templates with Pyodide disabled, so their Python tests never import the compiled module. Add a type check of Pyodide-enabled renders to both existing Rust template jobs. Render the committed SHA to avoid Copier cloning dirty CI fixtures and racing Git maintenance during cleanup.

Verified fresh renders of both templates with Pyodide enabled and disabled. Removing either stub reproduces unresolved-import. For both enabled renders, Python lint, make checks, Python runtime tests, native wheel builds, and source distribution builds passed on macOS with Python 3.11. Wheels contain the extension and stub; source distributions contain the stub and exclude compiled binaries. Rust/JS/WASM native checks used SKIP_HATCH_JS=1; the existing CI jobs retain full template tests.

Run template type checks with python -m ty check and let ty discover the Python environment. Verified both Rust templates with Pyodide enabled and disabled using this command.

After this merges, rerun Copier updates to regenerate the affected downstream PRs.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine timkpaine changed the title Add Rust extension type stubs and check Pyodide renders Fix Rust extension types and cross-platform type checks Oct 11, 2026
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine timkpaine changed the title Fix Rust extension types and cross-platform type checks Fix Rust extension types and simplify type checks Oct 11, 2026
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