Skip to content

Keep native binaries out of template source distributions - #202

Merged
timkpaine merged 1 commit into
python-project-templates:mainfrom
timkpaine:fix-native-sdist-artifacts
Oct 6, 2026
Merged

timkpaine merged 1 commit into
python-project-templates:mainfrom
timkpaine:fix-native-sdist-artifacts

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Keep compiled extensions out of source distributions generated by the C++, C++/JS/WASM, Rust, and Rust/JS/WASM templates. Native artifact patterns currently apply globally, so Hatch includes existing binaries even when sdist exclusions list them. Move those patterns to the wheel target and explicitly exclude .so, .dll, .dylib, and .pyd from sdists. Preserve existing JavaScript asset selection in both hybrid templates.

Add a CI archive check that seeds compiled files into generated projects and verifies sdists exclude them while retaining C++/Rust sources. The check fails on all four original templates and passes after the fix.

Regenerated all four variants and passed development setup, lint, distribution checks, and tests locally. Also verified a generated C++ project with a real compiled extension: its sdist excludes the binary and its wheel includes it. Script Ruff checks and git diff --check pass.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine merged commit 1fbf3a7 into python-project-templates:main Oct 6, 2026
21 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.

1 participant