Skip to content

Fix build hook compatibility with Hatchling 1.32.1 - #47

Merged
timkpaine merged 2 commits into
mainfrom
fix-hatchling-build-hook-interface
Sep 16, 2026
Merged

timkpaine merged 2 commits into
mainfrom
fix-hatchling-build-hook-interface

Conversation

@timkpaine

@timkpaine timkpaine commented Sep 16, 2026

Copy link
Copy Markdown
Member

Description

Hatchling 1.32.1 breaks plugin imports by adding a second generic parameter to BuildHookInterface. Remove runtime generic arguments from the build hook and add a registration/construction regression test. This preserves hook compatibility with older Hatchling versions.

The same upstream release also imports hatch.plugin.manager without declaring Hatch, breaking CLI builds with ModuleNotFoundError. Exclude exactly 1.32.1 in build-system, runtime, and development requirements so installations select a working backend without requiring Hatch. Future releases remain allowed within existing version bounds.

Verified without Hatch installed: all 2 JavaScript tests, including the native build fixture pass with resolved Hatchling 1.32.0, and isolated wheel/sdist builds pass. Hook regression tests were also verified against 1.20.0 and 1.32.1. Versions remain unchanged.

Type of Change

  • Bug fix

Checklist

  • Relevant local tests pass
  • Isolated wheel and source distribution builds pass
  • Full CI suite passes

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

Copy link
Copy Markdown
Contributor

Test Results

2 tests  +1   2 ✅ +1   3s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 149096d. ± Comparison against base commit 7a6ba06.

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.33%. Comparing base (7a6ba06) to head (149096d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   54.09%   58.33%   +4.23%     
==========================================
  Files           6        7       +1     
  Lines         122      132      +10     
==========================================
+ Hits           66       77      +11     
+ Misses         56       55       -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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timkpaine
timkpaine merged commit ef820c7 into main Sep 16, 2026
4 checks passed
@timkpaine
timkpaine deleted the fix-hatchling-build-hook-interface branch September 16, 2026 18: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