Skip to content

Add executable artifacts with shared-scripts install scheme#62

Merged
timkpaine merged 1 commit into
python-project-templates:mainfrom
Point72:tkp/bin
Jun 17, 2026
Merged

Add executable artifacts with shared-scripts install scheme#62
timkpaine merged 1 commit into
python-project-templates:mainfrom
Point72:tkp/bin

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Support shipping Rust binaries (bin/example targets) in wheels, in addition to the existing cdylib extension modules.

  • New "shared-scripts" install scheme places an artifact in the wheel's .data/scripts/ directory so pip install puts it on PATH (the executable equivalent of shared-data).
  • Executable artifacts (cargo-target-kind bin/example) are now copied: previously they fell through to the cdylib path and failed looking for a lib shared library.
  • Skip the implicit --crate-type cdylib rustc arg for executables, which would otherwise build a binary target as a library.
  • Add an executable_name() helper and a {executable} destination token.
  • Route both compiled and generated outputs through shared-scripts, and forward shared_scripts from the build plan to hatchling build_data.

Support shipping Rust binaries (bin/example targets) in wheels, in
addition to the existing cdylib extension modules.

- New "shared-scripts" install scheme places an artifact in the wheel's
  .data/scripts/ directory so `pip install` puts it on PATH (the
  executable equivalent of shared-data).
- Executable artifacts (cargo-target-kind bin/example) are now copied:
  previously they fell through to the cdylib path and failed looking for
  a lib<name> shared library.
- Skip the implicit --crate-type cdylib rustc arg for executables, which
  would otherwise build a binary target as a library.
- Add an executable_name() helper and a {executable} destination token.
- Route both compiled and generated outputs through shared-scripts, and
  forward shared_scripts from the build plan to hatchling build_data.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.41758% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.40%. Comparing base (8345819) to head (1ac949f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
hatch_rs/structs.py 78.84% 11 Missing ⚠️
hatch_rs/plugin.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   81.01%   81.40%   +0.38%     
==========================================
  Files          10       10              
  Lines        1354     1441      +87     
==========================================
+ Hits         1097     1173      +76     
- Misses        257      268      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timkpaine
timkpaine merged commit cbd8fb4 into python-project-templates:main Jun 17, 2026
5 checks passed
@timkpaine
timkpaine deleted the tkp/bin branch June 17, 2026 21:00
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