Skip to content

Link extensions against a library shipped by another installed package - #95

Merged
python-templates-automerge[bot] merged 2 commits into
mainfrom
package-library
Nov 12, 2026
Merged

python-templates-automerge[bot] merged 2 commits into
mainfrom
package-library

Conversation

@timkpaine

Copy link
Copy Markdown
Member

A library artifact may name an installed Python package with python-package instead of a manifest. hatch-rs locates the package in the build environment, takes the library from its lib/ and headers from its include/, links the consumer against it, and in bundled mode adds an rpath to the sibling package ($ORIGIN/../fsspec_rs/lib). In external mode the package is ignored and the library resolves from HATCH_RS_LIBRARY_ROOT, pkg-config, or $PREFIX as before, so a conda recipe builds unchanged. static and direct skip it as they do for any linked library.

This is what fsspec-kafka and the other fsspec extensions need to link libfsspec from the installed fsspec_rs wheel instead of compiling their own registry.

Adds a fixture project that links c_abi_library from the installed c_abi_bundle_project fixture and loads it through the rpath alone.

A library artifact may name an installed Python package with python-package instead of a manifest. hatch-rs takes the library from that package's lib/ and headers from include/, links the consumer against it, and adds an rpath to the sibling package in bundled mode. In external mode the package is ignored and the library resolves as before, so a conda recipe builds unchanged.

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

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.13793% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.14%. Comparing base (a6d532a) to head (327b93b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hatch_rs/tests/test_projects.py 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   91.77%   92.14%   +0.37%     
==========================================
  Files          15       15              
  Lines        2518     2624     +106     
==========================================
+ Hits         2311     2418     +107     
+ Misses        207      206       -1     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tag: automerge Automatically merge this PR when status checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant